|
@@ -9,11 +9,19 @@
|
|
|
:title-inactive-color="'#666666'"
|
|
|
ref="myTabs"
|
|
|
@change="handleTabChange">
|
|
|
- <van-tab :title="'未激活(' + total0 + ')'"></van-tab>
|
|
|
- <van-tab :title="'有效(' + total1 + ')'"></van-tab>
|
|
|
+ <van-tab :title="'未激活(' + total1 + ')'"></van-tab>
|
|
|
+ <van-tab :title="'有效(' + total2 + ')'"></van-tab>
|
|
|
</van-tabs>
|
|
|
- <Main :fansType="1" @updateTotal="updateTotal" ref="invalid"/>
|
|
|
- <Main :fansType="2" @updateTotal="updateTotal" ref="valid"/>
|
|
|
+ <Main
|
|
|
+ :fansType="1"
|
|
|
+ v-show="numActiveTab === 0"
|
|
|
+ @updateTotal="updateTotal"
|
|
|
+ ref="invalid"/>
|
|
|
+ <Main
|
|
|
+ :fansType="2"
|
|
|
+ v-show="numActiveTab === 1"
|
|
|
+ @updateTotal="updateTotal"
|
|
|
+ ref="valid"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -31,8 +39,8 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
numActiveTab: 0,
|
|
|
- total0: 0,
|
|
|
- total1: 0
|
|
|
+ total1: 0,
|
|
|
+ total2: 0
|
|
|
}
|
|
|
},
|
|
|
async mounted () {
|
|
@@ -51,6 +59,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
updateTotal (obj) {
|
|
|
+ console.log(obj)
|
|
|
const { type, total } = obj
|
|
|
this[`total${type}`] = total
|
|
|
|