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

fix(mp): add global method (createApp,createPage,createComponent)

上级 27083ae0
......@@ -624,7 +624,7 @@ var serviceContext = (function (vue) {
};
}
function normalizeErrMsg(errMsg) {
if (isString(errMsg)) {
if (!errMsg || isString(errMsg)) {
return errMsg;
}
if (errMsg.stack) {
......@@ -8813,7 +8813,7 @@ var serviceContext = (function (vue) {
if (keyboardHeightChange !== event.height) {
keyboardHeightChange = event.height;
emit(ON_KEYBOARD_HEIGHT_CHANGE, {
height: keyboardHeightChange
height: keyboardHeightChange,
});
}
});
......
......@@ -1448,7 +1448,7 @@ function beforeInvokeApi(name, args, protocol, options) {
}
}
function normalizeErrMsg(errMsg) {
if (shared.isString(errMsg)) {
if (!errMsg || shared.isString(errMsg)) {
return errMsg;
}
if (errMsg.stack) {
......
......@@ -2675,7 +2675,7 @@ function wrapperOffApi(name, fn, options) {
};
}
function normalizeErrMsg(errMsg) {
if (isString(errMsg)) {
if (!errMsg || isString(errMsg)) {
return errMsg;
}
if (errMsg.stack) {
......
......@@ -987,7 +987,7 @@ function createVueComponent(mpType, mpInstance, vueOptions, parent) {
});
}
function createPage(vueOptions) {
function createPage$1(vueOptions) {
vueOptions = vueOptions.default || vueOptions;
const pageOptions = {
onLoad(query) {
......@@ -1076,7 +1076,7 @@ function initVm(mpInstance, createComponent) {
}
}
}
function createComponent(vueOptions) {
function createComponent$1(vueOptions) {
vueOptions = vueOptions.default || vueOptions;
const mpComponentOptions = {
props: initComponentProps(vueOptions.props),
......@@ -1127,6 +1127,9 @@ function createComponent(vueOptions) {
return Component(mpComponentOptions);
}
const createApp = initCreateApp(parseAppOptions);
const createApp = initCreateApp(parseAppOptions);
my.createApp = createApp;
my.createPage = createPage;
my.createComponent = createComponent;
export { createApp, createComponent, createPage };
export { createApp, createComponent$1 as createComponent, createPage$1 as createPage };
......@@ -6,3 +6,6 @@ export { createPage } from './createPage'
export { createComponent } from './createComponent'
export const createApp = initCreateApp(parseAppOptions)
;(my as any).createApp = createApp
;(my as any).createPage = createPage
;(my as any).createComponent = createComponent
......@@ -1031,6 +1031,9 @@ var parsePageOptions = /*#__PURE__*/Object.freeze({
const createApp = initCreateApp(parseAppOptions);
const createPage = initCreatePage(parsePageOptions);
const createComponent = initCreateComponent(parseComponentOptions);
const createComponent = initCreateComponent(parseComponentOptions);
swan.createApp = createApp;
swan.createPage = createPage;
swan.createComponent = createComponent;
export { createApp, createComponent, createPage };
......@@ -13,3 +13,6 @@ import * as parseComponentOptions from './parseComponentOptions'
export const createApp = initCreateApp(parseAppOptions)
export const createPage = initCreatePage(parsePageOptions)
export const createComponent = initCreateComponent(parseComponentOptions)
;(swan as any).createApp = createApp
;(swan as any).createPage = createPage
;(swan as any).createComponent = createComponent
......@@ -926,6 +926,13 @@ var parseOptions = /*#__PURE__*/Object.freeze({
const createApp = initCreateApp();
const createPage = initCreatePage(parseOptions);
const createComponent = initCreateComponent(parseOptions);
const createComponent = initCreateComponent(parseOptions);
wx.createApp = createApp;
wx.createPage = createPage;
wx.createComponent = createComponent;
qq.createApp = createApp;
qq.createPage = createPage;
qq.createComponent = createComponent;
export { createApp, createComponent, createPage };
import {
createApp,
createPage,
createComponent,
} from '@dcloudio/uni-mp-weixin/src/runtime'
export * from '@dcloudio/uni-mp-weixin/src/runtime'
;(qq as any).createApp = createApp
;(qq as any).createPage = createPage
;(qq as any).createComponent = createComponent
......@@ -1085,6 +1085,9 @@ var parsePageOptions = /*#__PURE__*/Object.freeze({
const createApp = initCreateApp();
const createPage = initCreatePage(parsePageOptions);
const createComponent = initCreateComponent(parseComponentOptions);
const createComponent = initCreateComponent(parseComponentOptions);
tt.createApp = createApp;
tt.createPage = createPage;
tt.createComponent = createComponent;
export { createApp, createComponent, createPage };
......@@ -12,3 +12,6 @@ import * as parseComponentOptions from './parseComponentOptions'
export const createApp = initCreateApp()
export const createPage = initCreatePage(parsePageOptions)
export const createComponent = initCreateComponent(parseComponentOptions)
;(tt as any).createApp = createApp
;(tt as any).createPage = createPage
;(tt as any).createComponent = createComponent
......@@ -926,6 +926,9 @@ var parseOptions = /*#__PURE__*/Object.freeze({
const createApp = initCreateApp();
const createPage = initCreatePage(parseOptions);
const createComponent = initCreateComponent(parseOptions);
const createComponent = initCreateComponent(parseOptions);
wx.createApp = createApp;
wx.createPage = createPage;
wx.createComponent = createComponent;
export { createApp, createComponent, createPage };
......@@ -11,3 +11,6 @@ import * as parseOptions from './parseOptions'
export const createApp = initCreateApp()
export const createPage = initCreatePage(parseOptions)
export const createComponent = initCreateComponent(parseOptions)
;(wx as any).createApp = createApp
;(wx as any).createPage = createPage
;(wx as any).createComponent = createComponent
......@@ -1071,6 +1071,9 @@ var parsePageOptions = /*#__PURE__*/Object.freeze({
const createApp = initCreateApp();
const createPage = initCreatePage(parsePageOptions);
const createComponent = initCreateComponent(parseComponentOptions);
const createComponent = initCreateComponent(parseComponentOptions);
qa.createApp = createApp;
qa.createPage = createPage;
qa.createComponent = createComponent;
export { createApp, createComponent, createPage };
......@@ -12,3 +12,6 @@ import * as parseComponentOptions from './parseComponentOptions'
export const createApp = initCreateApp()
export const createPage = initCreatePage(parsePageOptions)
export const createComponent = initCreateComponent(parseComponentOptions)
;(qa as any).createApp = createApp
;(qa as any).createPage = createPage
;(qa as any).createComponent = createComponent
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册