feat: ✨ (store)增加了对未定义组件的处理,添加更新页签名称方法
- 在多级菜单详情示例中使用了新的标签名称
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
import router from "@/router";
|
||||
import { ElButton } from "element-plus";
|
||||
import { useTagsViewStore } from "@/store";
|
||||
|
||||
export default defineComponent({
|
||||
name: "ToDetail",
|
||||
setup() {
|
||||
const route = useRoute();
|
||||
const tagsViewStore = useTagsViewStore();
|
||||
|
||||
// 跳转详情
|
||||
const navigateToDetail = async (id: number) => {
|
||||
await router.push({
|
||||
path: "/detail/" + id,
|
||||
query: { message: `msg${id}` },
|
||||
});
|
||||
// 更改标题
|
||||
tagsViewStore.updateTagName(route.fullPath, `详情页缓存(id=${id})`);
|
||||
};
|
||||
return () =>
|
||||
h("div", null, [
|
||||
|
||||
Reference in New Issue
Block a user