feat: 新增改枪码录入页,修复深链接与标签栏刷新回首页问题
CI/CD Deploy (Web) / 构建前端镜像并部署 (push) Successful in 44s

This commit is contained in:
张家训
2026-09-10 09:55:42 +08:00
parent deefce7856
commit 15cae333a3
4 changed files with 363 additions and 4 deletions
@@ -197,8 +197,12 @@ export default {
}
},
mounted () {
// 默认关闭所有的标签
this.handleTagsOption('all')
// 默认关闭所有的标签(仅在进入首页时重置)。
// 注意:直接输入地址/刷新进入子页面时不能重置,因为 handleTagsOption('all') 会触发
// 父组件的 handleCloseTag(res, 'all'),进而 turnToPage('home') 把页面弹回首页,导致深链接失效。
if (this.$route.name === this.$config.homeName) {
this.handleTagsOption('all')
}
setTimeout(() => {
this.getTagElementByName(this.$route)
}, 200)
+7
View File
@@ -154,6 +154,13 @@ export default {
this.addTag({
route: this.$store.state.app.homeRoute
})
// 直接输入地址/刷新进入时,localStorage 恢复的标签栏里没有当前页面,
// 这里把它补进标签栏,而不是直接跳回首页,否则深链接会被弹回首页
if (this.$route.name && this.$route.name !== this.$config.homeName) {
this.addTag({
route: this.$route
})
}
this.setBreadCrumb(this.$route)
// 如果当前打开页面不在标签栏中,跳到homeName页
if (!this.tagNavList.find(item => item.name === this.$route.name)) {