|
|
@ -1,11 +1,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
const devLib = process.env.VUE_APP_DEVLIB === "dev"; |
|
|
|
console.log('当前版本======> for',process.env.VUE_APP_DEVLIB) |
|
|
|
if (window.__POWERED_BY_QIANKUN__) { |
|
|
|
// 注入乾坤处理过的publicPath
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
window.__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ + (devLib ? "/TIS_APP_TEMPLATE_KT/" : ''); |
|
|
|
__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ + (devLib ? "/TIS_APP_TEMPLATE_KT/" : ''); |
|
|
|
} |
|
|
|
import Vue from "vue"; |
|
|
|
import store from './store' |
|
|
@ -14,7 +11,7 @@ import {registerApps} from './scriptsLoader/index' |
|
|
|
import axios from 'axios' |
|
|
|
import Vuex from 'vuex' |
|
|
|
import EventBusExample from '../components/EventBusExample' |
|
|
|
import bus from './bus' |
|
|
|
import bus, { onMount, onSetup } from './bus' |
|
|
|
|
|
|
|
Vue.component('EventBusExample', EventBusExample) |
|
|
|
Vue.config.productionTip = false; |
|
|
@ -35,7 +32,8 @@ let _App, |
|
|
|
export function setup(App, options = {}) { |
|
|
|
_App = App; |
|
|
|
_options = options; |
|
|
|
bus.layouts = options.layout; |
|
|
|
onSetup(options) |
|
|
|
|
|
|
|
if (typeof _options.install === "function") { |
|
|
|
_options.install(Vue); |
|
|
|
} |
|
|
@ -90,17 +88,10 @@ export async function mount(props = {}) { |
|
|
|
Vue.prototype.$ajaxDelete = axios.delete |
|
|
|
Vue.prototype.$axios = axios; |
|
|
|
|
|
|
|
// 等待bus执行mount生命周期
|
|
|
|
await onMount(props) |
|
|
|
|
|
|
|
const {container} = props; |
|
|
|
// console.log('框架传来的参数', props.tis.components,props.tis.asserts)
|
|
|
|
//取得esplug
|
|
|
|
// console.log('当前运行环境',dev,'baseURL',props.tis.entry);
|
|
|
|
await bus.initData(props) |
|
|
|
console.log('app frame', bus.components, bus.asserts); |
|
|
|
//一些内部配置的component需要加入layouts
|
|
|
|
bus.initLayouts(bus.components); |
|
|
|
// widgets加入layouts
|
|
|
|
bus.initLayouts(bus.widgets); |
|
|
|
document.documentElement.setAttribute('data-device', "pc"); |
|
|
|
window.esapp = Object.assign({}, { |
|
|
|
Vue: Vue, |
|
|
|