refs #355 Fix side menu highlight when tag page
This commit is contained in:
parent
8ab2ac4ee3
commit
7115ad45fc
|
@ -42,7 +42,7 @@ export default {
|
|||
return this.$route.name === 'tag'
|
||||
},
|
||||
back () {
|
||||
this.$router.push({ name: 'hashtag-list' })
|
||||
this.$router.push({ path: `/${this.id()}/hashtag` })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,6 @@ export default {
|
|||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
this.reset()
|
||||
this.$store.commit('TimelineSpace/SideMenu/updateOverrideActivePath', `${this.$route.params.id}/hashtag`)
|
||||
this.load(this.$route.params.tag)
|
||||
.then(() => {
|
||||
loading.close()
|
||||
|
@ -67,6 +66,8 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
async load (tag) {
|
||||
this.$store.commit('TimelineSpace/SideMenu/updateOverrideActivePath', `/${this.$route.params.id}/hashtag`)
|
||||
|
||||
await this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/fetch', tag)
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<el-menu
|
||||
default-active="activeRoute"
|
||||
:default-active="activeRoute()"
|
||||
:background-color="themeColor"
|
||||
text-color="#909399"
|
||||
active-text-color="#ffffff"
|
||||
|
@ -88,7 +88,11 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
activeRoute () {
|
||||
return this.overrideActivePath || this.$route.path
|
||||
if (this.overrideActivePath === null) {
|
||||
return this.$route.path
|
||||
} else {
|
||||
return this.overrideActivePath
|
||||
}
|
||||
},
|
||||
id () {
|
||||
return this.$route.params.id
|
||||
|
|
Loading…
Reference in New Issue