26 lines
651 B
JavaScript
Raw Normal View History

2025-01-25 02:48:00 +00:00
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({});
};