import { defineConfig } from 'umi';
export default defineConfig({
base: '/data', // 子项目配置
qiankun: {
// 子项目配置
slave: {},
},
// 页面的title
title: '首页',
hash: true,
history: {
type: 'browser',
},
routes: [{ path: '/', component: '@/pages/index' }],
dva: {
immer: true,
hmr: false,
},
locale: {
default: 'zh-CN', // 汉化
antd: true,
title: false,
baseNavigator: true,
baseSeparator: '-',
},
cssLoader: {
localsConvention: 'camelCase',
},
nodeModulesTransform: {
type: 'none',
},
targets: {
ie: 11,
},
});
qiankun: {
// 子项目配置
// slave: {},
},
function storeTest(props) {
props.onGlobalStateChange((value, prev) => {
console.log(`[onGlobalStateChange ------- ${props.name}]:`, value, prev);
}, true);
}
export const qiankun = {
// 应用加载之前
async bootstrap(props) {
console.log('app1 bootstrap', props);
},
// 应用 render 之前触发
async mount(props) {
console.log('app1 mount', props);
storeTest(props);
},
// 应用卸载之后触发
async unmount(props) {
console.log('app1 unmount', props);
},
};