mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
fix: router
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { useRoute } from "vue-router";
|
||||
const route = useRoute();
|
||||
const index = route.params?.id ?? -1;
|
||||
const index = route.query?.id ?? -1;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -9,7 +9,7 @@ const activeName = ref("tag");
|
||||
|
||||
function toDetail(index: number) {
|
||||
useMultiTagsStoreHook().handleTags("push", {
|
||||
path: `/tabs/detail/${index}`,
|
||||
path: `/tabs/detail`,
|
||||
parentPath: route.matched[0].path,
|
||||
name: "tabDetail",
|
||||
meta: {
|
||||
@@ -20,7 +20,7 @@ function toDetail(index: number) {
|
||||
realPath: "/tabs/detail"
|
||||
}
|
||||
});
|
||||
router.push(`/tabs/detail/${index}`);
|
||||
router.push({ name: "tabDetail", query: { id: index } });
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user