fix: closing modal
This commit is contained in:
parent
e837621ef8
commit
e54d95802b
1 changed files with 14 additions and 3 deletions
|
@ -12,11 +12,22 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import TaskDetailView from './TaskDetailView'
|
import {computed} from 'vue'
|
||||||
import router from '@/router'
|
import {useRouter, useRoute} from 'vue-router'
|
||||||
|
|
||||||
|
import TaskDetailView from './TaskDetailView'
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
const historyState = computed(() => route.fullPath && window.history.state)
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
function close() {
|
function close() {
|
||||||
|
if (historyState.value) {
|
||||||
router.back()
|
router.back()
|
||||||
|
} else {
|
||||||
|
const backdropRoute = historyState.value?.backdropView && router.resolve(historyState.value.backdropView)
|
||||||
|
router.push(backdropRoute)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue