直接上代码
HTML部分
<div class='herder_left' @click="change"> 头部 </div> <div class='show_wrap' v-show="show"> 显示部分 </div>
js部分
data() { return { show:false, } }, mounted() { this.LopTime(); }, methods: { change(){ this.show = !this.show },
}
通过指令 v-show便可以完成