zoukankan      html  css  js  c++  java
  • react-project(二)

    一、package.json中的配置

    1.babel-plugin-import可以实现antd-mobile的按需加载

    "babel-plugin-import": "^1.6.3"
     
    "plugins": [
          [
            "import",
            {
    "libraryName": "antd-mobile",
              "style": "css"
            }
          ],
            "transform-decorators-legacy "
        ]
     
    2."transform-decorators-legacy "支持redux装饰器的@写法的插件
    3.前端webpack的接口是3000,后端express的接口是9093,如果前端直接调用后端,会发生跨域错误。所以,我们在本地3000的接口做一次转发,所有的请求都发送到了9093,这样我们就能调取nodeJS的接口。
    "proxy": "http://localhost:9093"
    4."cookie-parser": "^1.4.3"处理cookie
    二、登陆注册页面实现
    1.忘安装redux模块
    2.thunk引入错误 正确:import thunk from 'redux-thunk';
    3.proxy error
    重新安装npm install --save-dev babel-plugin-transform-decorators-legacy
    "transform-decorators-legacy"要放在其他的前面
    服务没有启动
     4.引入装饰器问题
    https://github.com/Microsoft/vscode/issues/28097#issuecomment-306560817
    5.安装utility库可以支持密码加密 md5
    6.安装body-parser库
     
  • 相关阅读:
    C#基础
    自动化测试
    C# 数据结构题目
    .NET基础知识
    Sharepoint题目
    题目总结2
    数据库索引
    题目总结(2014-1-10)
    Stack详解
    SpringBoot入门基础知识点
  • 原文地址:https://www.cnblogs.com/cdx0/p/react-project02.html
Copyright © 2011-2022 走看看