1 parent
c0e815ae63
commit
0fe2c70848
5 files changed
+465
-44
No files matched your search
@@ -10,7 +10,10 @@ const backTo = computed(() => {
|
||||
})
|
||||
|
||||
function goBack() {
|
||||
if (backTo.value) router.push({ name: backTo.value })
|
||||
// vue-router keeps the previous in-app location in history.state.back;
|
||||
// it's null when the page was opened directly, so fall back to backTo
|
||||
if (window.history.state?.back) router.back()
|
||||
else if (backTo.value) router.push({ name: backTo.value })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in new issue
Block a user