diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 2d5e690df74c3b8442434497dfd1808225e1a3e8..b9c202617e5d706e6e78ce6516b4f15419eb70cb 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -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); diff --git a/packages/uni-mp-alipay/dist/index.js b/packages/uni-mp-alipay/dist/index.js index d55d44278001f690545f68d077eb4d6ff782c6c9..397394de8c332a01432d9b0a12bb67b0bab75429 100644 --- a/packages/uni-mp-alipay/dist/index.js +++ b/packages/uni-mp-alipay/dist/index.js @@ -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); diff --git a/packages/uni-mp-baidu/dist/index.js b/packages/uni-mp-baidu/dist/index.js index 58ea34ca35526b7a9fea9426db88e95596a97b48..d5853f88cb0f3f92a10e5f70125b11642ec2c8fe 100644 --- a/packages/uni-mp-baidu/dist/index.js +++ b/packages/uni-mp-baidu/dist/index.js @@ -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); diff --git a/packages/uni-mp-kuaishou/dist/index.js b/packages/uni-mp-kuaishou/dist/index.js index e7922ce875a472431ac46095ffc0de0372f870c4..22b260989673cec960f94a63c8c4ba63e194e10f 100644 --- a/packages/uni-mp-kuaishou/dist/index.js +++ b/packages/uni-mp-kuaishou/dist/index.js @@ -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); diff --git a/packages/uni-mp-qq/dist/index.js b/packages/uni-mp-qq/dist/index.js index d916a5b67d5d7a878a3ac144ecf012e0dab7e226..023b119ccf7b598147aed0cfc850b0eacdc48668 100644 --- a/packages/uni-mp-qq/dist/index.js +++ b/packages/uni-mp-qq/dist/index.js @@ -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); diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js index b5e8d1142c7dc0176e1497011c3ea66a4253f6c4..07279f1b155fab6fcad34a78c3ee2772a5ba594e 100644 --- a/packages/uni-mp-toutiao/dist/index.js +++ b/packages/uni-mp-toutiao/dist/index.js @@ -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); diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index caba32a3b319b172721172284aed453b28ab062a..3927d7bc990d5be2ad5073f2fbade34f9a3ff41b 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -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); diff --git a/packages/uni-quickapp-webview/dist/index.js b/packages/uni-quickapp-webview/dist/index.js index 11f0f53d9f23d677e93f8470a2dad91b99edd989..3864b6089db47e1f98a3221e9ae80a4444da7fe2 100644 --- a/packages/uni-quickapp-webview/dist/index.js +++ b/packages/uni-quickapp-webview/dist/index.js @@ -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); diff --git a/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js b/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js index 1836603e4634e69fbdb2689127b45a26973a6d3b..3d3acf33875bd90162d9c860e583f9e742c6ea81 100644 --- a/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js +++ b/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js @@ -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)