|
@ -42,7 +42,7 @@ export function setup(App, options = {}) { |
|
|
// registerApps(_options.components)
|
|
|
// registerApps(_options.components)
|
|
|
// 独立运行时
|
|
|
// 独立运行时
|
|
|
if (!window.__POWERED_BY_QIANKUN__) { |
|
|
if (!window.__POWERED_BY_QIANKUN__) { |
|
|
Vue.prototype.$tis = tis; |
|
|
|
|
|
|
|
|
Vue.prototype.$tis = bus; |
|
|
// console.log('----------','独立运行')
|
|
|
// console.log('----------','独立运行')
|
|
|
mount(); |
|
|
mount(); |
|
|
} |
|
|
} |
|
@ -95,31 +95,7 @@ export async function mount(props = {}) { |
|
|
// console.log('框架传来的参数', props.tis.components,props.tis.asserts)
|
|
|
// console.log('框架传来的参数', props.tis.components,props.tis.asserts)
|
|
|
//取得esplug
|
|
|
//取得esplug
|
|
|
// console.log('当前运行环境',dev,'baseURL',props.tis.entry);
|
|
|
// console.log('当前运行环境',dev,'baseURL',props.tis.entry);
|
|
|
curBaseUrl = props.tis ? props.tis.entry : baseUrl; |
|
|
|
|
|
const esData = await axios.get(`${curBaseUrl}/esplug.json`).catch(err => console.error(err)); |
|
|
|
|
|
const asserts = await axios.get(`${curBaseUrl}/tisplatform.json`).catch(err => console.error(err)); |
|
|
|
|
|
try { |
|
|
|
|
|
//运行模式才取用框架返回的数据
|
|
|
|
|
|
if (props.tis && !dev) { |
|
|
|
|
|
console.log('框架传入的components:',props.tis.components) |
|
|
|
|
|
bus.components = props.tis.components ? [...props.tis.components,...esData.data.components] : esData.data.components; |
|
|
|
|
|
bus.asserts = Object.keys(props.tis.asserts).length !== 0 ? props.tis.asserts : asserts.data; |
|
|
|
|
|
bus.widgets = props.tis.widgets ? props.tis.widgets : esData.data.widgets; |
|
|
|
|
|
} else { |
|
|
|
|
|
bus.components = esData.data.components |
|
|
|
|
|
bus.asserts = asserts.data; |
|
|
|
|
|
bus.widgets = esData.data.widgets; |
|
|
|
|
|
} |
|
|
|
|
|
//避免不填此属性,默认懒加载
|
|
|
|
|
|
bus.components = bus.components.map(c => { |
|
|
|
|
|
if (!Object.prototype.hasOwnProperty.call(c, "lazy") && c.type !== "background") { |
|
|
|
|
|
c.lazy = true |
|
|
|
|
|
} |
|
|
|
|
|
return c; |
|
|
|
|
|
}) |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
console.error(e) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
await bus.initData(props) |
|
|
console.log('app frame', bus.components, bus.asserts); |
|
|
console.log('app frame', bus.components, bus.asserts); |
|
|
//一些内部配置的component需要加入layouts
|
|
|
//一些内部配置的component需要加入layouts
|
|
|
bus.initLayouts(bus.components); |
|
|
bus.initLayouts(bus.components); |
|
@ -143,7 +119,7 @@ export async function mount(props = {}) { |
|
|
registerAppAsync: function (source) { |
|
|
registerAppAsync: function (source) { |
|
|
return source |
|
|
return source |
|
|
}, |
|
|
}, |
|
|
tis: props.tis || tis, //新框架核心对象,
|
|
|
|
|
|
|
|
|
tis: props.tis || bus, //新框架核心对象,
|
|
|
flag: "", |
|
|
flag: "", |
|
|
ShareMap: window.esapp ? window.esapp.ShareMap : {}, |
|
|
ShareMap: window.esapp ? window.esapp.ShareMap : {}, |
|
|
}); |
|
|
}); |
|
@ -215,4 +191,4 @@ function swithTheme(param) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export default tis; |
|
|
|
|
|
|
|
|
export default bus; |