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'
|
return this.$route.name === 'tag'
|
||||||
},
|
},
|
||||||
back () {
|
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)'
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
})
|
})
|
||||||
this.reset()
|
this.reset()
|
||||||
this.$store.commit('TimelineSpace/SideMenu/updateOverrideActivePath', `${this.$route.params.id}/hashtag`)
|
|
||||||
this.load(this.$route.params.tag)
|
this.load(this.$route.params.tag)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
loading.close()
|
loading.close()
|
||||||
|
@ -67,6 +66,8 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async load (tag) {
|
async load (tag) {
|
||||||
|
this.$store.commit('TimelineSpace/SideMenu/updateOverrideActivePath', `/${this.$route.params.id}/hashtag`)
|
||||||
|
|
||||||
await this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/fetch', tag)
|
await this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/fetch', tag)
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-menu
|
<el-menu
|
||||||
default-active="activeRoute"
|
:default-active="activeRoute()"
|
||||||
:background-color="themeColor"
|
:background-color="themeColor"
|
||||||
text-color="#909399"
|
text-color="#909399"
|
||||||
active-text-color="#ffffff"
|
active-text-color="#ffffff"
|
||||||
|
@ -88,7 +88,11 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
activeRoute () {
|
activeRoute () {
|
||||||
return this.overrideActivePath || this.$route.path
|
if (this.overrideActivePath === null) {
|
||||||
|
return this.$route.path
|
||||||
|
} else {
|
||||||
|
return this.overrideActivePath
|
||||||
|
}
|
||||||
},
|
},
|
||||||
id () {
|
id () {
|
||||||
return this.$route.params.id
|
return this.$route.params.id
|
||||||
|
|
Loading…
Reference in New Issue