侧边栏展开收起时修改标题

This commit is contained in:
mengxiaolong
2020-12-01 15:49:09 +08:00
parent ebd7f53b8f
commit 52feefb9e5

View File

@@ -49,7 +49,7 @@
</van-tabs>
</div>
<!-- 侧边栏 -->
<van-popup v-model="isSideBarShow" position="left" :style="{ width: '50vw', height: '100vh' }">
<van-popup v-model="isSideBarShow" position="left" :style="{ width: '50vw', height: '100vh' }" @close="onSidebarClose">
<p class="title">指标</p>
<span class="data-type" :class="{ 'data-active': index === typeIndex }" v-for="(type, index) in dataTypes" :key="index" @click="changeDataType(index)">{{
type
@@ -215,6 +215,9 @@ export default {
this.initData()
},
methods: {
onSidebarClose() {
document.title = '排名'
},
changeSearchType() {
this.isSideBarShow = true
document.title = '返回'
@@ -410,7 +413,6 @@ export default {
},
// 切换数据类型事件
async changeDataType(index) {
document.title = '排名'
if (this.typeIndex === index) {
this.isSideBarShow = false
return