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

fix(mp): Compatible with vue-i18n

上级 ef948ac5
......@@ -1312,7 +1312,12 @@ function parseBaseApp (vm, {
delete this.$options.mpType;
delete this.$options.mpInstance;
if (this.mpType === 'page') { // hack vue-i18n
const app = getApp();
if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n;
}
}
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
......
......@@ -1954,7 +1954,12 @@ function parseBaseApp (vm, {
delete this.$options.mpType;
delete this.$options.mpInstance;
if (this.mpType === 'page') { // hack vue-i18n
const app = getApp();
if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n;
}
}
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
......
......@@ -1643,7 +1643,12 @@ function parseBaseApp (vm, {
delete this.$options.mpType;
delete this.$options.mpInstance;
if (this.mpType === 'page') { // hack vue-i18n
const app = getApp();
if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n;
}
}
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
......
......@@ -1395,7 +1395,12 @@ function parseBaseApp (vm, {
delete this.$options.mpType;
delete this.$options.mpInstance;
if (this.mpType === 'page') { // hack vue-i18n
const app = getApp();
if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n;
}
}
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
......
......@@ -1556,7 +1556,12 @@ function parseBaseApp (vm, {
delete this.$options.mpType;
delete this.$options.mpInstance;
if (this.mpType === 'page') { // hack vue-i18n
const app = getApp();
if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n;
}
}
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
......
......@@ -1648,7 +1648,12 @@ function parseBaseApp (vm, {
delete this.$options.mpType;
delete this.$options.mpInstance;
if (this.mpType === 'page') { // hack vue-i18n
const app = getApp();
if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n;
}
}
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
......
......@@ -1313,7 +1313,12 @@ function parseBaseApp (vm, {
delete this.$options.mpType;
delete this.$options.mpInstance;
if (this.mpType === 'page') { // hack vue-i18n
const app = getApp();
if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n;
}
}
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
......
......@@ -1370,7 +1370,12 @@ function parseBaseApp (vm, {
delete this.$options.mpType;
delete this.$options.mpInstance;
if (this.mpType === 'page') { // hack vue-i18n
const app = getApp();
if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n;
}
}
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
......
......@@ -69,7 +69,12 @@ export default function parseBaseApp (vm, {
delete this.$options.mpType
delete this.$options.mpInstance
if (this.mpType === 'page') { // hack vue-i18n
const app = getApp()
if (app.$vm && app.$vm.$i18n) {
this._i18n = app.$vm.$i18n
}
}
if (this.mpType !== 'app') {
initRefs(this)
initMocks(this, mocks)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册