refactor(Layout): 优化 Layout 组件中的标题处理逻辑
- 移除了对 getEcosystem 函数的调用,直接使用 ecosystem 参数获取标题别名 - 优化了代码格式,调整了大括号的位置 - 删除了注释掉的 van-nav-bar 组件的结束标签
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<template #right>
|
||||
<van-icon name="ellipsis" size="18" />
|
||||
</template>
|
||||
</van-nav-bar> -->
|
||||
</van-nav-bar> -->
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
@@ -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
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user