<template> <view> <!-- 内容 --> <view class="content_box"> <view class="content"> <!-- 分类 --> <view class="classification"> <text @click="taskSwitch(0)">全部</text> <text @click="taskSwitch(1)">我的发表</text> </view> <hr> <!-- --> <view class="whole" v-if="category == 0"> 全部的页面 </view> <view class="publish" v-if="category == 1"> 我的发表 </view> </view> </view> </view> </template> <script> import card from "../../coponents/card/card.vue" export default { data() { return { category: 0, }} methods: { taskSwitch(i) { if (i == 0) { this.category = i } else { this.category = i } } } } </script>
样式自己调
标签:category,vue,..,切换,tab,card From: https://www.cnblogs.com/0722tian/p/16905543.html