1、路由设定,增加meta参数
{ path: '/', name: 'Home', component: Home, meta: { index: 0, showFooter: true //由这个参数对路由进行控制 } },
2、通过v-show绑定到tab上
<div class="burger_div" v-show="$route.meta.showFooter"> <div class="burger_div_list"> <div class="title">头部</div> <div class="item" @click="gopage(i.path)" v-for="(i,index2) in tablist" :key="index2">{{i.name}}</div> </div> <div class="burger_switch" @click="setswitch()">开关</div> <div class="burger_div_bg" @click="off()"></div> </div>