提交 101f8219 编写于 作者: Q qiang

chore: build

上级 d2e80217
......@@ -1147,6 +1147,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook$1 (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -1810,6 +1833,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -2084,6 +2108,7 @@ function parseBasePage (vuePageOptions, {
const pageOptions = parseComponent$1(vuePageOptions);
initHooks(pageOptions.methods, hooks$2, vuePageOptions);
initUnknownHooks(pageOptions.methods, vuePageOptions);
pageOptions.methods.onLoad = function (query) {
this.options = query;
......
......@@ -6542,7 +6542,8 @@ var serviceContext = (function () {
const {
hostPackageName, hostName, osLanguage,
hostVersion, hostLanguage, hostTheme,
appId, appName, appVersion, appVersionCode
appId, appName, appVersion, appVersionCode,
appWgtVersion
} = systemInfo;
const appLanguage = uni
......@@ -6556,6 +6557,7 @@ var serviceContext = (function () {
appName,
appVersion,
appVersionCode,
appWgtVersion,
appLanguage,
enableDebug: false,
hostSDKVersion: undefined,
......
......@@ -1387,12 +1387,6 @@ const protocols = { // 需要做转换的 API 列表
hideHomeButton: {
name: 'hideBackHome'
},
saveImageToPhotosAlbum: {
name: 'saveImage',
args: {
filePath: 'url'
}
},
saveVideoToPhotosAlbum: {
args: {
filePath: 'src'
......@@ -1993,6 +1987,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -2616,6 +2633,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(my.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -3091,6 +3109,7 @@ function parsePage (vuePageOptions) {
};
initHooks(pageOptions, hooks$1, vuePageOptions);
initUnknownHooks(pageOptions, vuePageOptions);
if (Array.isArray(vueOptions.wxsCallMethods)) {
vueOptions.wxsCallMethods.forEach(callMethod => {
......
......@@ -1610,6 +1610,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook$1 (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -2273,6 +2296,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(swan.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -2638,6 +2662,7 @@ function parseBasePage (vuePageOptions, {
const pageOptions = parseComponent(vuePageOptions);
initHooks(pageOptions.methods, hooks$1, vuePageOptions);
initUnknownHooks(pageOptions.methods, vuePageOptions);
pageOptions.methods.onLoad = function (query) {
this.options = query;
......
......@@ -1227,6 +1227,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook$1 (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -1945,6 +1968,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(jd.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -2212,6 +2236,7 @@ function parseBasePage (vuePageOptions, {
const pageOptions = parseComponent$1(vuePageOptions);
initHooks(pageOptions.methods, hooks$1, vuePageOptions);
initUnknownHooks(pageOptions.methods, vuePageOptions);
pageOptions.methods.onLoad = function (query) {
this.options = query;
......
......@@ -1395,6 +1395,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook$1 (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -2032,6 +2055,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(ks.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -2344,6 +2368,7 @@ function parseBasePage (vuePageOptions, {
const pageOptions = parseComponent$1(vuePageOptions);
initHooks(pageOptions.methods, hooks$1, vuePageOptions);
initUnknownHooks(pageOptions.methods, vuePageOptions);
pageOptions.methods.onLoad = function (query) {
this.options = query;
......
......@@ -1445,6 +1445,35 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook$1 (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
if (
hook === 'onError'
) {
return getApp().$vm.$callHook(hook, args)
}
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -2089,6 +2118,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(tt.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -2439,6 +2469,7 @@ function parseBasePage (vuePageOptions, {
const pageOptions = parseComponent(vuePageOptions);
initHooks(pageOptions.methods, hooks$1, vuePageOptions);
initUnknownHooks(pageOptions.methods, vuePageOptions);
pageOptions.methods.onLoad = function (query) {
this.options = query;
......
......@@ -1556,6 +1556,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook$1 (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -2198,6 +2221,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -2466,6 +2490,7 @@ function parseBasePage (vuePageOptions, {
const pageOptions = parseComponent$1(vuePageOptions);
initHooks(pageOptions.methods, hooks$1, vuePageOptions);
initUnknownHooks(pageOptions.methods, vuePageOptions);
pageOptions.methods.onLoad = function (query) {
this.options = query;
......
......@@ -1652,6 +1652,35 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook$1 (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
if (
hook === 'onError'
) {
return getApp().$vm.$callHook(hook, args)
}
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -2296,6 +2325,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(tt.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -2680,6 +2710,7 @@ function parseBasePage (vuePageOptions, {
const pageOptions = parseComponent(vuePageOptions);
initHooks(pageOptions.methods, hooks$1, vuePageOptions);
initUnknownHooks(pageOptions.methods, vuePageOptions);
pageOptions.methods.onLoad = function (query) {
this.options = query;
......
......@@ -1378,6 +1378,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook$1 (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -2045,6 +2068,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -2312,6 +2336,7 @@ function parseBasePage (vuePageOptions, {
const pageOptions = parseComponent(vuePageOptions);
initHooks(pageOptions.methods, hooks$1, vuePageOptions);
initUnknownHooks(pageOptions.methods, vuePageOptions);
pageOptions.methods.onLoad = function (query) {
this.options = query;
......
......@@ -1225,6 +1225,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook$1 (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -1943,6 +1966,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(xhs.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -2192,6 +2216,7 @@ function parsePage (vuePageOptions) {
};
initHooks(pageOptions, hooks$1, vuePageOptions);
initUnknownHooks(pageOptions, vuePageOptions);
if (Array.isArray(vueOptions.wxsCallMethods)) {
vueOptions.wxsCallMethods.forEach(callMethod => {
......
......@@ -1396,6 +1396,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function initUnknownHooks (mpOptions, vueOptions, excludes = []) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
}
function findHooks (vueOptions, hooks = []) {
if (vueOptions) {
Object.keys(vueOptions).forEach((name) => {
if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
hooks.push(name);
}
});
}
return hooks
}
function initHook$1 (mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.__call_hook(hook, args)
};
}
}
function initVueComponent (Vue, vueOptions) {
vueOptions = vueOptions.default || vueOptions;
let VueComponent;
......@@ -1978,6 +2001,7 @@ function parseBaseApp (vm, {
initAppLocale(Vue, vm, normalizeLocale(qa.getSystemInfoSync().language) || LOCALE_EN);
initHooks(appOptions, hooks);
initUnknownHooks(appOptions, vm.$options);
return appOptions
}
......@@ -2335,6 +2359,7 @@ function parseBasePage (vuePageOptions, {
const pageOptions = parseComponent(vuePageOptions);
initHooks(pageOptions.methods, hooks$1, vuePageOptions);
initUnknownHooks(pageOptions.methods, vuePageOptions);
pageOptions.methods.onLoad = function (query) {
this.options = query;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册