• html引入react库,不搭脚手架。


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" charset="utf-8">
        <title>Title</title>
        <link rel="stylesheet" href="css/login.css">
    </head>
    <body>
    <div id="root"></div>
    
    <script src="js/util/react.development.js"  ></script>
    <script src="js/util/react-dom.development.js"></script>
    <script src="js/util/babel.min.js"></script>
    <script src="js/util/jquery-3.2.1.min.js"></script>
    
    <script src="js/config/urlconfig.js"></script>
    <script src="js/config/ajaxUtil.js"></script>
    
    <script src="js/component/main.js" type="text/babel"></script>
    <script src="js/component/login.js" type="text/babel"></script>
    <script src="js/component/page.js" type="text/babel"></script>
    <script type="text/babel" >
        ReactDOM.render(
            <Pageindex />,
            document.getElementById('root')
        );
    </script>
    </body>
    </html>

    react 必须引入react、react-dom、以及将jsx语法转换为js的babel。一旦引入,js里可直接调用react 对象,无需导入。

    //用户登陆判断
    class Pageindex extends React.Component { constructor(props) { super(props);
    this.state={ isBindwechat:-1 } } componentDidMount(){ this.getAuthorization(); } getToken=()=>{ } getAuthorization=()=>{ var openId=""; sessionStorage.setItem("openid",openId); var that=this; posturlNetWork(url_.getAuthorization,"openId="+openId,function (data) { if(data.code==4000){ that.setState({ isBindwechat: 0 }) } else if(data.code=1000){ //存储token sessionStorage.setItem(companyCode+"daying", data.data.Authorization); //用来做心跳包使用 sessionStorage.setItem("accountId", data.data.userInfo.id); Authorization_Str=data.data.Authorization; userName=data.data.userInfo.name; that.setState({ isBindwechat: 1 }) } }) } render() { if(this.state.isBindwechat==1){ return <PageMain/>; } else if(this.state.isBindwechat==0){ return <LoginBind/> } else{ return null } } }
  • 相关阅读:
    3.6 批量维护来源准则/查看来源准则
    3.5 供货比例(来源准则)控制
    3.4 新供应商引入
    3.3 集团化采购管理
    3.2 采购管理目标
    3.1 采购管理规划
    2.8 生产辅料管理
    2.7 车间任务的批量移动和批量完工入库
    2.6 自动更新车间任务的供应类型和完工子库
    2.5 总装与部装跟单任务的同步发放
  • 原文地址:https://www.cnblogs.com/yangqing22/p/14061662.html
Copyright © 2020-2023  润新知