Fix getting back to the kanban board after closing a task popup
This commit is contained in:
parent
3e71b76c25
commit
d7112c99c7
1 changed files with 15 additions and 2 deletions
|
@ -13,16 +13,29 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TaskDetailView from './TaskDetailView'
|
import TaskDetailView from './TaskDetailView'
|
||||||
import router from '../../router'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TaskDetailViewModal',
|
name: 'TaskDetailViewModal',
|
||||||
components: {
|
components: {
|
||||||
TaskDetailView,
|
TaskDetailView,
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lastRoute: null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeRouteEnter(to, from, next) {
|
||||||
|
next(vm => {
|
||||||
|
vm.lastRoute = from
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
router.back()
|
if (this.lastRoute === null) {
|
||||||
|
this.$router.back()
|
||||||
|
} else {
|
||||||
|
this.$router.push(this.lastRoute)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue