vuex add namespaced

This commit is contained in:
Pan
2019-03-20 13:44:42 +08:00
parent 7c33568883
commit 0c50029cf7
20 changed files with 414 additions and 382 deletions

View File

@@ -186,7 +186,7 @@ export default {
setTagsViewTitle() {
const title = this.lang === 'zh' ? '编辑文章' : 'Edit Article'
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.postForm.id}` })
this.$store.dispatch('updateVisitedView', route)
this.$store.dispatch('tagsView/updateVisitedView', route)
},
submitForm() {
this.postForm.display_time = parseInt(this.display_time / 1000)

View File

@@ -110,7 +110,7 @@ export default {
},
set(lang) {
this.$i18n.locale = lang
this.$store.dispatch('setLanguage', lang)
this.$store.dispatch('app/setLanguage', lang)
}
}
},

View File

@@ -136,7 +136,7 @@ export default {
if (valid) {
this.loading = true
// dispatch @/store/modules/user login action
this.$store.dispatch('login', this.loginForm).then(() => {
this.$store.dispatch('user/login', this.loginForm).then(() => {
this.loading = false
this.$router.push({ path: this.redirect || '/' })
}).catch(() => {

View File

@@ -22,7 +22,7 @@ export default {
return this.roles[0]
},
set(val) {
this.$store.dispatch('changeRoles', val).then(() => {
this.$store.dispatch('user/changeRoles', val).then(() => {
this.$emit('change')
})
}