9cb3d0dc by lihua

修改页面标题名称

1 parent c0db4eb4
...@@ -55,7 +55,9 @@ const routes: RouteRecordRaw[] = [ ...@@ -55,7 +55,9 @@ const routes: RouteRecordRaw[] = [
55 activeMenu: '/data-basic/user-manage' 55 activeMenu: '/data-basic/user-manage'
56 }, 56 },
57 beforeEnter: (to) => { 57 beforeEnter: (to) => {
58 if (to.query.userName) { 58 if (to.query.isDetail) {
59 to.meta.title = `详情-${to.query.userName}`;
60 } else if (to.query.isEdit) {
59 to.meta.title = `编辑-${to.query.userName}`; 61 to.meta.title = `编辑-${to.query.userName}`;
60 } 62 }
61 } 63 }
......
...@@ -398,6 +398,20 @@ onBeforeMount(() => { ...@@ -398,6 +398,20 @@ onBeforeMount(() => {
398 }) 398 })
399 }) 399 })
400 400
401 onActivated(() => {
402 let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === route.fullPath);
403 if (tab) {
404 if (isDetail.value) {
405 tab.meta.title = `详情-${route.query.userName}`;
406 } else if (isEdit.value) {
407 tab.meta.title = `编辑-${route.query.userName}`;
408 } else {
409 tab.meta.title = `新增用户`;
410 }
411 document.title = tab.meta.title;
412 };
413 })
414
401 onMounted(() => { 415 onMounted(() => {
402 416
403 }) 417 })
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!