X-neuron / antdFront

Antdfront is a set of multi tab experimental react microfrontend template
MIT License
202 stars 49 forks source link

微前端里vue2打开后直接报错 #17

Closed chj-damon closed 3 years ago

chj-damon commented 3 years ago

http://127.0.0.1:8080/micro/vue2 image

X-neuron commented 3 years ago

可以 进入到 example/vue2 的文件夹下 tyarn 或 cnpm i 后, npm run dev 得到和启动vue2页面,得到该页面地址后 比如是:http://localhost:8000 等 ,配置antdFront/src/config/route.js:

              {
                  name: "微前端",
                  path: "/micro",
                  icon: "PaperClipOutlined",
                  children: [
                    // {
                    //   name: "material-ui",
                    //   path: "material/*",
                    //   access: "microOpen",
                    //   component: "http://localhost:8002" // 微前端配置
                    // },
                    {
                      name: "vue2测试",
                      path: "vue2/*",
                      access: "microOpen",
                      component: "http://localhost:8000", // 微前端配置
                    },
                  ]
                }

找到以上部分,将该处的component 改成 vue2的地址。 后npm run dev 即可查看到效果...

chj-damon commented 3 years ago

nice,谢谢!