-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
主应用vue2 当子应用为vite时候,控制台加载异常会递归出大量的iframe 标签 #904
Comments
Hello @hzfvictory. In order to facilitate location and troubleshooting, we need you to provide a realistic GitHub repository. |
配置项大致如下 子应用都是vite加vue3 ,子应用的域名跟主应用公用的一个 {
path: '/content-app/*',
name: 'ContentApp',
component: 'ViteTemplate',
meta: {
title: '内容运营',
micro: {
name: 'content-app',
baseroute: '/content-app/',
url: 'https://xxx.com/content-app/',
preFetch: true,
iframe: true,
},
},
},
{
path: '/activity-app',
name: 'ActivityApp',
component: 'HomeApp',
meta: {
title: '活动运营',
},
},
{
path: '/project-app/*',
name: 'ProjectApp',
component: 'ViteTemplate',
meta: {
title: '项目运营',
micro: {
name: 'project-app',
baseroute: '/project-app/',
url: 'https://xxxx.com/project-app/',
preFetch: true,
iframe: true,
},
},
},
{
path: '/strategy-app/*',
name: 'StrategyApp',
component: 'ViteTemplate',
meta: {
title: '策略中心',
micro: {
name: 'strategy-app',
baseroute: '/strategy-app/',
url: 'https://xxx.com/strategy-app/',
preFetch: true,
iframe: true,
},
},
}, |
基座和子应用域名相同,地址相同,基座的路由优先级高,相当于基座潜入基座,死循环了 |
对于这种情况 我改下 baseroute 就解决了吗 ; |
死循环肯定循环嵌套,路由配置有问题导致的 |
本地就剩这一个子应用了 ; 这个配置路由、域名 、 baseroute都不一样 也还是死循环 { |
能提供一个复现的demo吗 |
公司代码不好弄 我把vite的预渲染关闭就正常,但是性能太拉胯了 |
<script>if(window.parent !== window) {window.stop()}</script> 看到其他issues 有提到加一行这个代码 加上后我这死循环也得到了解决。 这个是阻止iframe加载资源吗 ,或者说添加后会不会导致预加载失败 |
<script>if(window.parent !== window) {window.stop()}</script> 阻止加载主应用资源的 |
问题描述
主应用vue2 当子应用为vite时候,控制台加载异常会递归出大量的iframe 标签
复现步骤
上传截图
复现仓库
环境信息
The text was updated successfully, but these errors were encountered: