直接上代碼
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便可以完成