9cb3d0dc by lihua

修改页面标题名称

1 parent c0db4eb4
......@@ -55,7 +55,9 @@ const routes: RouteRecordRaw[] = [
activeMenu: '/data-basic/user-manage'
},
beforeEnter: (to) => {
if (to.query.userName) {
if (to.query.isDetail) {
to.meta.title = `详情-${to.query.userName}`;
} else if (to.query.isEdit) {
to.meta.title = `编辑-${to.query.userName}`;
}
}
......
......@@ -398,6 +398,20 @@ onBeforeMount(() => {
})
})
onActivated(() => {
let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === route.fullPath);
if (tab) {
if (isDetail.value) {
tab.meta.title = `详情-${route.query.userName}`;
} else if (isEdit.value) {
tab.meta.title = `编辑-${route.query.userName}`;
} else {
tab.meta.title = `新增用户`;
}
document.title = tab.meta.title;
};
})
onMounted(() => {
})
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!