Skip to content
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+vue3,无法正常显示子应用 #743

Open
fcb123 opened this issue Jun 13, 2024 · 1 comment
Open

vue2升级到vite+vue3,无法正常显示子应用 #743

fcb123 opened this issue Jun 13, 2024 · 1 comment

Comments

@fcb123
Copy link

fcb123 commented Jun 13, 2024

原先vue2中采用
createMicroApp({
name: 'microApp',
url: [
'/xxx/xxx.umd.js',
'/css/index.css',
],
container: appContainer,
})
appHistory.push(‘/seller’,{},true)
可以跳转,移植到vue3+vite后跳转白屏,查看到js css文件是请求的,并插入到html中,但指定的元素内没有加载内容,

后尝试采用
registerMicroApps([
{
name: 'microApp‘,
activePath: '/seller',
container: appContainer,
url: [
'/xxx/xxx.umd.js',
'/css/index.css',
],
},
]);
start()
这种方式,但不请求js css两个文件,是我哪里配置不对吗

@ClarkXia
Copy link
Collaborator

关注 loadScriptMode 设置 https://micro-frontends.ice.work/docs/api/ice-stark/#loadscriptmode-
vite 构建的产物需要用 import 的方式加载

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants