提交 2a2334ed 编写于 作者: fxy060608's avatar fxy060608

wip(mp): add legacy runtime

上级 5dce14fb
......@@ -26,7 +26,7 @@ export interface UniMiniProgramPluginOptions {
darkmode: boolean
subpackages: boolean
}
project: {
project?: {
filename: string
source: Record<string, unknown>
}
......
......@@ -4931,10 +4931,21 @@ function initApp(app) {
var plugin = {
install(app) {
initApp(app);
// TODO 旧编译器使用了$createElement 导致告警,当切换到新编译器时,移除此类代码
app.config.globalProperties.$createElement = () => { };
const oldMount = app.mount;
app.mount = function mount(rootContainer) {
const instance = oldMount.call(app, rootContainer);
global.createApp(instance);
if (global.createApp) {
global.createApp(instance);
}
else {
// @ts-ignore 旧编译器
if (typeof createMiniProgramApp !== 'undefined') {
// @ts-ignore
createMiniProgramApp(instance);
}
}
return instance;
};
},
......
此差异已折叠。
......@@ -5,10 +5,23 @@ import { initApp } from '@dcloudio/uni-vue'
export default {
install(app: App) {
initApp(app)
// TODO 旧编译器使用了$createElement 导致告警,当切换到新编译器时,移除此类代码
app.config.globalProperties.$createElement = () => {}
const oldMount = app.mount
app.mount = function mount(rootContainer: any) {
const instance = oldMount.call(app, rootContainer)
;(global as any).createApp(instance)
if ((global as any).createApp) {
;(global as any).createApp(instance)
} else {
// @ts-ignore 旧编译器
if (typeof createMiniProgramApp !== 'undefined') {
// @ts-ignore
createMiniProgramApp(instance)
}
}
return instance
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册