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页面

相关推荐
IT_陈寒2 小时前
Vite静态资源加载把我坑惨了
前端·人工智能·后端
herinspace2 小时前
管家婆实用贴-如何分离和附加数据库
开发语言·前端·javascript·数据库·语音识别
小码哥_常2 小时前
从MVC到MVI:一文吃透架构模式进化史
前端
嗷o嗷o2 小时前
Android BLE 的 notify 和 indicate 到底有什么区别
前端
豹哥学前端2 小时前
别再背“var 提升,let/const 不提升”了:揭开暂时性死区的真实面目
前端·面试
lar_slw3 小时前
k8s部署前端项目
前端·容器·kubernetes
拉拉肥_King3 小时前
Ant Design Table 横向滚动条神秘消失?我是如何一步步找到真凶的
前端·javascript
GreenTea3 小时前
DeepSeek-V4 技术报告深度分析:基础研究创新全景
前端·人工智能·后端
河阿里4 小时前
HTML5标准完全教学手册
前端·html·html5
吴声子夜歌4 小时前
Vue3——新语法
前端·javascript·vue.js