Skip to content

Commit 8ee5fa3

Browse files
committed
Merge branch 'dev'
2 parents 46fde3f + 2f571cb commit 8ee5fa3

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

example/mfe.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
/* eslint-disable no-console */
2-
export default function (render) {
3-
if (!window.__POWERED_BY_QIANKUN__) {
4-
render()
5-
}
6-
}
7-
82
// qiankun bootstrap hook
93
export function bootstrap () {
104
console.log('nuxt app bootstraped')
@@ -18,7 +12,7 @@ export async function mount (render, props) {
1812

1913
// call after nuxt rendered
2014
export function mounted (vm) {
21-
console.log(vm)
15+
console.log('mounted', vm)
2216
}
2317

2418
// qiankun update hook

lib/client.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,13 @@ const renderNuxt = (props = {}) => createApp().then((__app) => mountApp(__app, p
9494

9595
<% if (!MFE) { %>renderNuxt()<% } else {%>
9696
// prepare for rendering Nuxt app without qiankun
97-
if (typeof MFE.default === 'function') {
98-
MFE.default(renderNuxt)
97+
if (!window.__POWERED_BY_QIANKUN__) {
98+
renderNuxt().then(async () => {
99+
if (typeof MFE.mounted === 'function' && instance) {
100+
return MFE.mounted(instance, {})
101+
}
102+
})
103+
.catch(errorHandler)
99104
}
100105

101106
export async function bootstrap() {

0 commit comments

Comments
 (0)