react 使用笔记

1.学习:https://reactjs.bootcss.com/learn

2.项目启动报错:Delete ␍ prettier/prettier

解决:https://blog.csdn.net/qq_30272167/article/details/133280165

3.访问地址配置

文件:config-overrides.js

javascript 复制代码
devServer: function (configFunction) {
  return function (proxy, allowedHost) {
    const config = configFunction(proxy, allowedHost);
    config.proxy = {
      "/api": {
        // target: "http://10.30.1.12",//服务器
        target: "http://localhost:9999",//测试
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          "^/api": "",
        },
      },
    };
    return config;
  };
},

4.菜单路由配置

router=》module=》pages.js

javascript 复制代码
// 单位配置
  {
    path: "/vip/configure",
    component: React.lazy(() => import("@/pages/vip/configure")),
    permis: false,
  },

其中:pages/vip/configure 指的是页面路径,默认访问index.jsx页面

相关推荐
Csvn5 小时前
WASM
前端
修己xj6 小时前
我用 AI 给自己写了一个 Markdown 编辑器,然后把它开源了
前端
FRing036 小时前
vue2干货总结2(v-bind、v-for、v-model、指令修饰符、v-bind操作class和style)
开发语言·前端·vue.js·vue2
幸运小猿7 小时前
模拟慢上传-处理超时重试image 丢失线上问题
前端·javascript·html
moshuying8 小时前
网购能买Token了!
前端
h_65432108 小时前
echarts实现柱状图加一条横线
前端·echarts
风骏时光牛马9 小时前
生成一个后端标题,只需要一个标题,不需要其他的任何文本。
前端
子非鱼@Itfuture9 小时前
关于前后端联调中登录状态/登录信息失效?
java·前端
郭小李9 小时前
openFeign入门
java·开发语言·前端
馒头不想说话9 小时前
AI当运营,帮你省人力
前端