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

fix(mp): vuex store

上级 7678d1b5
......@@ -1112,7 +1112,11 @@ const hooks = [
function parseBaseApp (vm, {
mocks,
initRefs
}) {
}) {
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
Vue.prototype.mpHost = "app-plus";
Vue.mixin({
......@@ -1136,10 +1140,6 @@ function parseBaseApp (vm, {
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
} else {
if (this.$options.store) { // vuex store
Vue.prototype.$store = this.$options.store;
}
}
}
});
......
......@@ -1513,7 +1513,11 @@ const hooks = [
function parseBaseApp (vm, {
mocks,
initRefs
}) {
}) {
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
Vue.prototype.mpHost = "mp-alipay";
Vue.mixin({
......@@ -1537,10 +1541,6 @@ function parseBaseApp (vm, {
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
} else {
if (this.$options.store) { // vuex store
Vue.prototype.$store = this.$options.store;
}
}
}
});
......
......@@ -1258,7 +1258,11 @@ const hooks = [
function parseBaseApp (vm, {
mocks,
initRefs
}) {
}) {
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
Vue.prototype.mpHost = "mp-baidu";
Vue.mixin({
......@@ -1282,10 +1286,6 @@ function parseBaseApp (vm, {
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
} else {
if (this.$options.store) { // vuex store
Vue.prototype.$store = this.$options.store;
}
}
}
});
......
......@@ -1176,7 +1176,11 @@ const hooks = [
function parseBaseApp (vm, {
mocks,
initRefs
}) {
}) {
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
Vue.prototype.mpHost = "mp-qq";
Vue.mixin({
......@@ -1200,10 +1204,6 @@ function parseBaseApp (vm, {
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
} else {
if (this.$options.store) { // vuex store
Vue.prototype.$store = this.$options.store;
}
}
}
});
......
......@@ -1268,7 +1268,11 @@ const hooks = [
function parseBaseApp (vm, {
mocks,
initRefs
}) {
}) {
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
Vue.prototype.mpHost = "mp-toutiao";
Vue.mixin({
......@@ -1292,10 +1296,6 @@ function parseBaseApp (vm, {
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
} else {
if (this.$options.store) { // vuex store
Vue.prototype.$store = this.$options.store;
}
}
}
});
......
......@@ -1116,7 +1116,11 @@ const hooks = [
function parseBaseApp (vm, {
mocks,
initRefs
}) {
}) {
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
Vue.prototype.mpHost = "mp-weixin";
Vue.mixin({
......@@ -1140,10 +1144,6 @@ function parseBaseApp (vm, {
if (this.mpType !== 'app') {
initRefs(this);
initMocks(this, mocks);
} else {
if (this.$options.store) { // vuex store
Vue.prototype.$store = this.$options.store;
}
}
}
});
......
module.exports = (api, options, rootOptions) => {
let version = '*'
if (require('./package.json').version.indexOf('alpha') !== -1) {
version = '^2.0.0-alpha-22420190823001'
const mainVersion = require('./package.json').version
if (mainVersion.indexOf('alpha') !== -1) {
version = '^' + mainVersion
}
api.extendPackage(pkg => {
delete pkg.postcss
......
......@@ -15,7 +15,11 @@ const hooks = [
export default function parseBaseApp (vm, {
mocks,
initRefs
}) {
}) {
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store
}
Vue.prototype.mpHost = __PLATFORM__
Vue.mixin({
......@@ -39,10 +43,6 @@ export default function parseBaseApp (vm, {
if (this.mpType !== 'app') {
initRefs(this)
initMocks(this, mocks)
} else {
if (this.$options.store) { // vuex store
Vue.prototype.$store = this.$options.store
}
}
}
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册