26 lines
651 B
JavaScript
26 lines
651 B
JavaScript
|
|
import { renderWithQiankun, qiankunWindow } from 'vite-plugin-qiankun/dist/helper';
|
||
|
|
|
||
|
|
export const registerMicroApps = (app) => {
|
||
|
|
const initQiankun = () => {
|
||
|
|
renderWithQiankun({
|
||
|
|
bootstrap() {
|
||
|
|
console.log('bootstrap');
|
||
|
|
},
|
||
|
|
mount(props) {
|
||
|
|
console.log('mount', props);
|
||
|
|
render(props);
|
||
|
|
},
|
||
|
|
update(props) {
|
||
|
|
console.log('update', props);
|
||
|
|
},
|
||
|
|
unmount(props) {
|
||
|
|
console.log('unmount', props);
|
||
|
|
},
|
||
|
|
});
|
||
|
|
};
|
||
|
|
const render = ({ container }) => {
|
||
|
|
app.mount(container ? container : '#app');
|
||
|
|
};
|
||
|
|
qiankunWindow.__POWERED_BY_QIANKUN__ ? initQiankun() : render({});
|
||
|
|
};
|