1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-13 23:20:12 +08:00

fix: Error with this.unsubscribe is not a function (#499)

This commit is contained in:
Edwin Betancourt 2020-05-18 12:16:20 -04:00 committed by GitHub
parent 603532a09f
commit d24666370f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 5 deletions

View File

@ -40,6 +40,7 @@ export default {
data() { data() {
return { return {
documents: [], documents: [],
unsubscribe: () => {},
search: '' search: ''
} }
}, },
@ -89,7 +90,7 @@ export default {
}) })
}, },
subscribeChanges() { subscribeChanges() {
this.$store.subscribe((mutation, state) => { return this.$store.subscribe((mutation, state) => {
if (mutation.type === 'notifyDashboardRefresh') { if (mutation.type === 'notifyDashboardRefresh') {
this.getPendingDocuments() this.getPendingDocuments()
} }

View File

@ -49,6 +49,7 @@ export default {
data() { data() {
return { return {
recentItems: [], recentItems: [],
unsubscribe: () => {},
isLoaded: true, isLoaded: true,
search: '', search: '',
accentRegexp: /[\u0300-\u036f]/g accentRegexp: /[\u0300-\u036f]/g
@ -144,7 +145,7 @@ export default {
} }
}, },
subscribeChanges() { subscribeChanges() {
this.$store.subscribe((mutation, state) => { return this.$store.subscribe((mutation, state) => {
if (mutation.type === 'notifyDashboardRefresh') { if (mutation.type === 'notifyDashboardRefresh') {
this.getRecentItems() this.getRecentItems()
} }

View File

@ -54,6 +54,7 @@ export default {
data() { data() {
return { return {
favorites: [], favorites: [],
unsubscribe: () => {},
isLoaded: true, isLoaded: true,
search: '', search: '',
accentRegexp: /[\u0300-\u036f]/g accentRegexp: /[\u0300-\u036f]/g
@ -108,7 +109,7 @@ export default {
}) })
}, },
subscribeChanges() { subscribeChanges() {
this.$store.subscribe((mutation, state) => { return this.$store.subscribe((mutation, state) => {
if (mutation.type === 'notifyDashboardRefresh') { if (mutation.type === 'notifyDashboardRefresh') {
this.getFavoritesList() this.getFavoritesList()
} }

View File

@ -37,7 +37,8 @@ export default {
mixins: [formMixin], mixins: [formMixin],
data() { data() {
return { return {
fieldsList fieldsList,
unsubscribe: () => {}
} }
}, },
created() { created() {

View File

@ -96,7 +96,8 @@ export default {
}, },
data() { data() {
return { return {
fieldsList fieldsList,
unsubscribe: () => {}
} }
}, },
computed: { computed: {