fix(runtime): 获取dsl字段出错

This commit is contained in:
roymondchen 2022-05-20 14:35:07 +08:00 committed by jia000
parent 662a3d61ea
commit bb97c4c6d0
6 changed files with 7 additions and 7 deletions

View File

@ -1104,7 +1104,7 @@ Object.values(entry.plugins).forEach((plugin) => {
magicApp.use(plugin);
});
const app = new App({
config: ((getUrlParam("localPreview") ? getLocalConfig() : window.magicUiConfig) || [])[0] || {},
config: ((getUrlParam("localPreview") ? getLocalConfig() : window.magicDSL) || [])[0] || {},
curPage: getUrlParam("page")
});
magicApp.config.globalProperties.app = app;

View File

@ -29,7 +29,7 @@ import entry from '../comp-entry';
import App from './App';
declare global {
interface Window {
magicUiConfig: MApp[];
magicDSL: MApp[];
magicPresetComponents: any;
magicPresetConfigs: any;
magicPresetValues: any;
@ -48,7 +48,7 @@ const getLocalConfig = (): MApp[] => {
};
const app = new Core({
config: ((getUrlParam('localPreview') ? getLocalConfig() : window.magicUiConfig) || [])[0] || {},
config: ((getUrlParam('localPreview') ? getLocalConfig() : window.magicDSL) || [])[0] || {},
curPage: getUrlParam('page'),
});

View File

@ -20,7 +20,7 @@ import { MApp } from '@tmagic/schema';
declare global {
interface Window {
magicUiConfig: MApp[];
magicDSL: MApp[];
magicPresetComponents: any;
magicPresetConfigs: any;
magicPresetValues: any;

View File

@ -32,7 +32,7 @@ Vue.use(CompositionApi);
Vue.use(request);
const app = new Core({
config: ((getUrlParam('localPreview') ? getLocalConfig() : window.magicUiConfig) || [])[0] || {},
config: ((getUrlParam('localPreview') ? getLocalConfig() : window.magicDSL) || [])[0] || {},
curPage: getUrlParam('page'),
});

View File

@ -20,7 +20,7 @@ import { MApp } from '@tmagic/schema';
declare global {
interface Window {
magicUiConfig: MApp[];
magicDSL: MApp[];
magicPresetComponents: any;
magicPresetConfigs: any;
magicPresetValues: any;

View File

@ -40,7 +40,7 @@ Object.values(entry.plugins).forEach((plugin: any) => {
});
const app = new Core({
config: ((getUrlParam('localPreview') ? getLocalConfig() : window.magicUiConfig) || [])[0] || {},
config: ((getUrlParam('localPreview') ? getLocalConfig() : window.magicDSL) || [])[0] || {},
curPage: getUrlParam('page'),
});