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

build(mp): bump vue from 3.0.9 to 3.2.11

上级 2e0b1101
...@@ -736,9 +736,13 @@ const getLocale = () => { ...@@ -736,9 +736,13 @@ const getLocale = () => {
return uni.getSystemInfoSync().language || 'zh-Hans'; return uni.getSystemInfoSync().language || 'zh-Hans';
}; };
const setLocale = (locale) => { const setLocale = (locale) => {
const oldLocale = getApp().$vm.$locale; const app = getApp();
if (!app) {
return false;
}
const oldLocale = app.$vm.$locale;
if (oldLocale !== locale) { if (oldLocale !== locale) {
getApp().$vm.$locale = locale; app.$vm.$locale = locale;
onLocaleChangeCallbacks.forEach((fn) => fn({ locale })); onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
return true; return true;
} }
......
...@@ -736,9 +736,13 @@ const getLocale = () => { ...@@ -736,9 +736,13 @@ const getLocale = () => {
return uni.getSystemInfoSync().language || 'zh-Hans'; return uni.getSystemInfoSync().language || 'zh-Hans';
}; };
const setLocale = (locale) => { const setLocale = (locale) => {
const oldLocale = getApp().$vm.$locale; const app = getApp();
if (!app) {
return false;
}
const oldLocale = app.$vm.$locale;
if (oldLocale !== locale) { if (oldLocale !== locale) {
getApp().$vm.$locale = locale; app.$vm.$locale = locale;
onLocaleChangeCallbacks.forEach((fn) => fn({ locale })); onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
return true; return true;
} }
......
...@@ -736,9 +736,13 @@ const getLocale = () => { ...@@ -736,9 +736,13 @@ const getLocale = () => {
return uni.getSystemInfoSync().language || 'zh-Hans'; return uni.getSystemInfoSync().language || 'zh-Hans';
}; };
const setLocale = (locale) => { const setLocale = (locale) => {
const oldLocale = getApp().$vm.$locale; const app = getApp();
if (!app) {
return false;
}
const oldLocale = app.$vm.$locale;
if (oldLocale !== locale) { if (oldLocale !== locale) {
getApp().$vm.$locale = locale; app.$vm.$locale = locale;
onLocaleChangeCallbacks.forEach((fn) => fn({ locale })); onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
return true; return true;
} }
......
...@@ -736,9 +736,13 @@ const getLocale = () => { ...@@ -736,9 +736,13 @@ const getLocale = () => {
return uni.getSystemInfoSync().language || 'zh-Hans'; return uni.getSystemInfoSync().language || 'zh-Hans';
}; };
const setLocale = (locale) => { const setLocale = (locale) => {
const oldLocale = getApp().$vm.$locale; const app = getApp();
if (!app) {
return false;
}
const oldLocale = app.$vm.$locale;
if (oldLocale !== locale) { if (oldLocale !== locale) {
getApp().$vm.$locale = locale; app.$vm.$locale = locale;
onLocaleChangeCallbacks.forEach((fn) => fn({ locale })); onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
return true; return true;
} }
......
...@@ -736,9 +736,13 @@ const getLocale = () => { ...@@ -736,9 +736,13 @@ const getLocale = () => {
return uni.getSystemInfoSync().language || 'zh-Hans'; return uni.getSystemInfoSync().language || 'zh-Hans';
}; };
const setLocale = (locale) => { const setLocale = (locale) => {
const oldLocale = getApp().$vm.$locale; const app = getApp();
if (!app) {
return false;
}
const oldLocale = app.$vm.$locale;
if (oldLocale !== locale) { if (oldLocale !== locale) {
getApp().$vm.$locale = locale; app.$vm.$locale = locale;
onLocaleChangeCallbacks.forEach((fn) => fn({ locale })); onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
return true; return true;
} }
......
...@@ -1333,7 +1333,7 @@ function handleLink({ detail: { vuePid, nodeId, webviewId }, }) { ...@@ -1333,7 +1333,7 @@ function handleLink({ detail: { vuePid, nodeId, webviewId }, }) {
initInjections(vm); initInjections(vm);
initProvide(vm); initProvide(vm);
} }
vm.$callSyncHook('created'); vm.$callCreatedHook();
vm.$callHook('mounted'); vm.$callHook('mounted');
vm.$callHook(ON_READY); vm.$callHook(ON_READY);
} }
...@@ -1356,7 +1356,7 @@ function initLifetimes(lifetimesOptions) { ...@@ -1356,7 +1356,7 @@ function initLifetimes(lifetimesOptions) {
return extend(initLifetimes$1(lifetimesOptions), { return extend(initLifetimes$1(lifetimesOptions), {
ready() { ready() {
if (this.$vm && lifetimesOptions.isPage(this)) { if (this.$vm && lifetimesOptions.isPage(this)) {
this.$vm.$callSyncHook('created'); this.$vm.$callCreatedHook();
this.$vm.$callHook('mounted'); this.$vm.$callHook('mounted');
this.$vm.$callHook(ON_READY); this.$vm.$callHook(ON_READY);
} }
......
...@@ -700,9 +700,13 @@ const getLocale = () => { ...@@ -700,9 +700,13 @@ const getLocale = () => {
return uni.getSystemInfoSync().language || 'zh-Hans'; return uni.getSystemInfoSync().language || 'zh-Hans';
}; };
const setLocale = (locale) => { const setLocale = (locale) => {
const oldLocale = getApp().$vm.$locale; const app = getApp();
if (!app) {
return false;
}
const oldLocale = app.$vm.$locale;
if (oldLocale !== locale) { if (oldLocale !== locale) {
getApp().$vm.$locale = locale; app.$vm.$locale = locale;
onLocaleChangeCallbacks.forEach((fn) => fn({ locale })); onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
return true; return true;
} }
......
...@@ -736,9 +736,13 @@ const getLocale = () => { ...@@ -736,9 +736,13 @@ const getLocale = () => {
return uni.getSystemInfoSync().language || 'zh-Hans'; return uni.getSystemInfoSync().language || 'zh-Hans';
}; };
const setLocale = (locale) => { const setLocale = (locale) => {
const oldLocale = getApp().$vm.$locale; const app = getApp();
if (!app) {
return false;
}
const oldLocale = app.$vm.$locale;
if (oldLocale !== locale) { if (oldLocale !== locale) {
getApp().$vm.$locale = locale; app.$vm.$locale = locale;
onLocaleChangeCallbacks.forEach((fn) => fn({ locale })); onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
return true; return true;
} }
......
...@@ -1222,7 +1222,7 @@ function initLifetimes(lifetimesOptions) { ...@@ -1222,7 +1222,7 @@ function initLifetimes(lifetimesOptions) {
if (this.pageinstance) { if (this.pageinstance) {
this.__webviewId__ = this.pageinstance.__pageId__; this.__webviewId__ = this.pageinstance.__pageId__;
} }
this.$vm.$callSyncHook('created'); this.$vm.$callCreatedHook();
this.$vm.$callHook('mounted'); this.$vm.$callHook('mounted');
this.$vm.$callHook(ON_READY); this.$vm.$callHook(ON_READY);
} }
...@@ -1279,7 +1279,7 @@ function handleLink({ detail: { nodeId, webviewId }, }) { ...@@ -1279,7 +1279,7 @@ function handleLink({ detail: { nodeId, webviewId }, }) {
initInjections(vm); initInjections(vm);
initProvide(vm); initProvide(vm);
} }
vm.$callSyncHook('created'); vm.$callCreatedHook();
}; };
const mountedVm = function () { const mountedVm = function () {
// 处理当前 vm 子 // 处理当前 vm 子
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册