✨ Support subroutes of settings
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
import { MenuIcon } from "lucide-vue-next";
|
||||
import { computed } from "vue";
|
||||
import { useRoute, useRouter, RouterLink } from "vue-router";
|
||||
import { lastRoute } from "../router/index";
|
||||
import { lastDataRoute } from "../router/index";
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const routeName = computed(() => route.name);
|
||||
function goBack() {
|
||||
if (routeName.value != "title.settings") return;
|
||||
if (lastRoute.value.name) router.go(-1);
|
||||
if (!routeName.value.startsWith("title.settings")) return;
|
||||
if (lastDataRoute.value.name) router.push(lastDataRoute.value.path);
|
||||
else router.push("/timetable");
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user