<tab :line-width=2 active-color='#227bd0'> <tab-item selected badge-label="1" @on-item-click="tabClick()">上午</tab-item> <tab-item badge-color="#fff" @on-item-click="tabClick()">下午</tab-item> </tab>
<div v-if="index" class="sw">
上午的所有内容...
</div>
<div v-else class="xw">
下午的所有内容
</div>
<script>
import { Tab, TabItem } from 'vux'
export default {
components: {
Tab,
TabItem
},
data () {
return {
index: true,
},
methods: {
tabClick () {
this.index = !this.index
}
}
}