123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import Vue from 'vue';
- import App from './App.vue';
- import VueRouter from 'vue-router';
- import routes from './router';
- import store from './store';
- import ElementUI from 'element-ui';
- import 'element-ui/lib/theme-chalk/index.css';
- import './public-path.js';
- import dict from '@lib/dict.js';
- import tree from '@lib/tree.js';
- import resChange from '@lib/resChange.js';
- Vue.config.productionTip = false;
- Vue.use(VueRouter);
- Vue.use(ElementUI);
- Vue.use(dict);
- Vue.use(tree);
- Vue.use(resChange);
- let router = null;
- let instance = null;
- function render (props = {}) {
- const { container } = props;
- router = new VueRouter({
- base: window.__POWERED_BY_QIANKUN__ ? '/admin/discuss/' : '/',
- mode: 'history',
- routes
- });
- instance = new Vue({
- router,
- store,
- render: (h) => h(App)
- }).$mount(container ? container.querySelector('#app') : '#app');
- }
- // 独立运行时
- if (!window.__POWERED_BY_QIANKUN__) {
- render();
- }
- export async function bootstrap () {}
- export async function mount (props) {
- render(props);
- }
- export async function unmount () {
- instance.$destroy();
- instance.$el.innerHTML = '';
- instance = null;
- router = null;
- }
|