Skip to content

Commit

Permalink
fix(mp): vuex store
Browse files Browse the repository at this point in the history
  • Loading branch information
fxy060608 committed Sep 2, 2019
1 parent 7678d1b commit 1573f1a
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 37 deletions.
10 changes: 5 additions & 5 deletions packages/uni-app-plus/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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;
}
}
}
});
Expand Down
10 changes: 5 additions & 5 deletions packages/uni-mp-alipay/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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;
}
}
}
});
Expand Down
10 changes: 5 additions & 5 deletions packages/uni-mp-baidu/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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;
}
}
}
});
Expand Down
10 changes: 5 additions & 5 deletions packages/uni-mp-qq/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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;
}
}
}
});
Expand Down
10 changes: 5 additions & 5 deletions packages/uni-mp-toutiao/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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;
}
}
}
});
Expand Down
10 changes: 5 additions & 5 deletions packages/uni-mp-weixin/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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;
}
}
}
});
Expand Down
5 changes: 3 additions & 2 deletions packages/vue-cli-plugin-uni/generator.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
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
Expand Down
10 changes: 5 additions & 5 deletions src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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
}
}
}
})
Expand Down

0 comments on commit 1573f1a

Please sign in to comment.