From e1d5990ba6c32a49272a0bdd15241616116a13ca Mon Sep 17 00:00:00 2001 From: huangze Date: Mon, 7 Jul 2025 19:38:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor(Layout):=20=E4=BC=98=E5=8C=96=20Layout?= =?UTF-8?q?=20=E7=BB=84=E4=BB=B6=E4=B8=AD=E7=9A=84=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了对 getEcosystem 函数的调用,直接使用 ecosystem 参数获取标题别名 - 优化了代码格式,调整了大括号的位置 - 删除了注释掉的 van-nav-bar 组件的结束标签 --- src/views/app/layout/Layout.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/app/layout/Layout.vue b/src/views/app/layout/Layout.vue index 6328ab0..46e2543 100644 --- a/src/views/app/layout/Layout.vue +++ b/src/views/app/layout/Layout.vue @@ -4,7 +4,7 @@ - --> + --> @@ -23,13 +23,13 @@ export default { let title = this.$route.meta.title if (name === "service") { const ecosystem = this.$route.params.ecosystem - title = getAlias(getEcosystem(ecosystem)) + title = getAlias(ecosystem) } return title } }, - watch:{ - $route(to, from){ + watch: { + $route(to, from) { document.title = this.title } },