refactor(Layout): 优化 Layout 组件中的标题处理逻辑

- 移除了对 getEcosystem 函数的调用,直接使用 ecosystem 参数获取标题别名
- 优化了代码格式,调整了大括号的位置
- 删除了注释掉的 van-nav-bar 组件的结束标签
This commit is contained in:
huangze
2025-07-07 19:38:33 +08:00
parent bdb8c6c4c0
commit e1d5990ba6

View File

@@ -4,7 +4,7 @@
<template #right> <template #right>
<van-icon name="ellipsis" size="18" /> <van-icon name="ellipsis" size="18" />
</template> </template>
</van-nav-bar> --> </van-nav-bar> -->
<router-view /> <router-view />
</div> </div>
</template> </template>
@@ -23,13 +23,13 @@ export default {
let title = this.$route.meta.title let title = this.$route.meta.title
if (name === "service") { if (name === "service") {
const ecosystem = this.$route.params.ecosystem const ecosystem = this.$route.params.ecosystem
title = getAlias(getEcosystem(ecosystem)) title = getAlias(ecosystem)
} }
return title return title
} }
}, },
watch:{ watch: {
$route(to, from){ $route(to, from) {
document.title = this.title document.title = this.title
} }
}, },