我无法在主页上隐藏按钮组。
单击按钮moveTo(0)或滚动到顶部
时隐藏 show: function() {
this.scrollTop = (window.pageYOffset !== undefined) ? window.pageYOffset
: (document.documentElement || document.body.parentNode || document.body).scrollTop;
}
答案 0 :(得分:0)
那么就这样做v-if="index !== 0"
示例:
<div class="button-group" v-if="index !== 0">
<button type="button" :class="{active:index ==0}" @click="moveTo(0)">home</button>
<button type="button" :class="{active:index ==1}" @click="moveTo(1)">about</button>
<button type="button" :class="{active:index ==2}" @click="moveTo(2)">contacts</button>
</div>
这样就可以了解