Commit ff5057ad97b7e708643a69575fa8c3c2ccb111f6
1 parent
cc2ec317
前端集成qiankun,支持微前端开发
Showing
1 changed file
with
12 additions
and
0 deletions
ant-design-vue-jeecg/src/components/layouts/TabLayout.vue
... | ... | @@ -28,6 +28,9 @@ |
28 | 28 | </template> |
29 | 29 | <!-- update-end-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 --> |
30 | 30 | </div> |
31 | + <!-- update-begin-author:zyf date:20211129 for:qiankun 挂载子应用盒子 --> | |
32 | + <div id="content" class="app-view-box"></div> | |
33 | + <!-- update-end-author:zyf date:20211129 for: qiankun 挂载子应用盒子--> | |
31 | 34 | </global-layout> |
32 | 35 | </template> |
33 | 36 | |
... | ... | @@ -38,6 +41,7 @@ |
38 | 41 | import { triggerWindowResizeEvent } from '@/utils/util' |
39 | 42 | import Vue from 'vue' |
40 | 43 | import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types' |
44 | + import registerApps from "@/qiankun"; | |
41 | 45 | |
42 | 46 | const indexKey = '/dashboard/analysis' |
43 | 47 | |
... | ... | @@ -92,6 +96,14 @@ |
92 | 96 | this.activePage = currentRoute.fullPath |
93 | 97 | }, |
94 | 98 | mounted() { |
99 | + if (process.env.VUE_APP_QIANKUN == 'true') { | |
100 | + //update-begin-author:zyf date:20211129 for:qiankun 注册子应用 | |
101 | + if (!window.qiankunStarted) { | |
102 | + window.qiankunStarted = true; | |
103 | + registerApps(); | |
104 | + } | |
105 | + //update-end-author:zyf date:20211129 for:qiankun 注册子应用 | |
106 | + } | |
95 | 107 | }, |
96 | 108 | watch: { |
97 | 109 | '$route': function(newRoute) { |
... | ... |