Comments (20)
通过fetch访问子项目,需要子项目进行可跨域配置,vue.config.js:
devServer: {
headers: {
'Access-Control-Allow-Origin': '*'
}
}
from vue-cli-plugin-qiankun.
子项目启动时端口号有变吗,主项目开发时是依赖端口号的
from vue-cli-plugin-qiankun.
没变,直接把代码拉下来后运行那4句,就报错了。在win7和win10都试了,报错信息一致
from vue-cli-plugin-qiankun.
yarn serve:all 后单独访问 8081 和 8082 都是好的吗
from vue-cli-plugin-qiankun.
单独访问8081和8082是ok的,不能在主页面切换foo-app
from vue-cli-plugin-qiankun.
我这儿 mac 没问题,晚上回去用 win 再试下看看,之前应该也都是好的
from vue-cli-plugin-qiankun.
还是没复现,你看下主应用加载 foo-app 的请求成功了没,返回的结果是啥
from vue-cli-plugin-qiankun.
from vue-cli-plugin-qiankun.
看眼网络请求的结果
from vue-cli-plugin-qiankun.
解决了吗?
from vue-cli-plugin-qiankun.
配置了
headers: {
'Access-Control-Allow-Origin': '*'
}
还是不行
from vue-cli-plugin-qiankun.
Failed to load http://localhost:8081/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
from vue-cli-plugin-qiankun.
Failed to load http://localhost:8081/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
配置完后重启子项目
from vue-cli-plugin-qiankun.
使用 localhost
from vue-cli-plugin-qiankun.
遇到同样的问题,请问解决了吗?
from vue-cli-plugin-qiankun.
有后续么?同样的问题 愁死了
from vue-cli-plugin-qiankun.
同
from vue-cli-plugin-qiankun.
有解决吗
from vue-cli-plugin-qiankun.
same here
from vue-cli-plugin-qiankun.
通过fetch访问子项目,需要子项目进行可跨域配置,vue.config.js:
devServer: { headers: { 'Access-Control-Allow-Origin': '*' } }
感谢,修改子应用的webpack后重启项目,成功解决
from vue-cli-plugin-qiankun.
Related Issues (14)
- 引用组件路径过长问题 HOT 2
- 想要做一个公共组件应用,其他的组件如何引用呢?
- "export 'ɵBrowserPlatformLocation' was not found HOT 2
- examples里的子项目报eslint的错误. 我确定eslint都是被安装过的 HOT 2
- 如果我用vue/cli创建项目时选择 Vue3-preview, 这个插件就不行 HOT 7
- mounted方法调用两次
- 在对应子模块下刷新的问题 HOT 1
- 父应用无法感知子应用路由切换
- build后打开,在子应用路径下刷新路径丢失 HOT 8
- 有办法将已有的vue项目转化为主项目或者子项目吗? HOT 2
- vuejs DevTools 无法调试微前端项目 HOT 1
- 安装不了依赖。 HOT 8
- qiankun 2.x版本有实践么? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-cli-plugin-qiankun.