fix: fix user view routing, refactor users view

This commit is contained in:
woothu
2020-03-19 13:00:04 +01:00
parent b9d9b6a124
commit e1972c2cea
4 changed files with 61 additions and 68 deletions
+11 -1
View File
@@ -26,6 +26,16 @@
import usersData from './UsersData'
export default {
name: 'User',
beforeRouteEnter(to, from, next) {
next(vm => {
vm.usersOpened = from.fullPath.includes('users')
})
},
data () {
return {
usersOpened: null
}
},
computed: {
fields () {
return [
@@ -48,7 +58,7 @@ export default {
},
methods: {
goBack() {
this.$router.go(-1)
this.usersOpened ? this.$router.go(-1) : this.$router.push({path: '/users'})
}
}
}