new Vue({ el: "#app", data: { isshow:false }, methods: { toggle: function(){ this.isshow = !this.isshow } } })
<div id="app"> <button v-on:click="toggle">Click Me</button> <div class="hoge" v-show="isshow"> hoge </div> </div>
body { background: #20262E; padding: 20px; font-family: Helvetica; } #app { transition: all 0.2s; } button { background: #0084ff; border: none; border-radius: 5px; padding: 8px 14px; font-size: 15px; color: #fff; } .hoge { width: 100%; height: 10rem; background-color: #eb6ea5; }