2023年3月12日
vue-tabs组件封装(适用h5,微信小程序)
前段时间做了一个web小程序项目,业务上有tabs需求,所以咱就开始动手拆分-封装。
父组件:
<template>
<div class="content">
<Tabs class="tabGroup"></Tabs>
</div>
</template>
<script>
import Tabs from "../components/tabs/tabs.vue"
export default {
components:{
Tabs,
},
data() {
return {
};
},
computed: {
},
onLoad(options) {
},
onShow() {
},
methods: {
}
}
</script>
看子组件:
<template>
<view>
<scroll-view class="scroll-view_H" scroll-x="true">
<view class="scroll-view-item_H" v-for="(tab,index) in tabBars" :key="tab.id" :id="tab.id"
@click="checkIndex(index)">
<image :src="tab.icon" v-if="tab.icon" :class="titleIconMap[index]"></image>
<image :src="tab.active" v-if="tab.active" :class="navIndex==index ? 'activite' :'activiteDisable'">
</image>
{{tab.name}}
</view>
</scroll-view>
<div class="tabPanel">
<!-- 内容切换 -->
<view class="goods-wrap" v-if="navIndex==0">
<!-- 拼团goods -->
</view>
<view class="goods-wrap" v-if="navIndex==1">
<!-- 商品--goods -->
</view>
<view class="goods-wrap" v-if="navIndex==2">
<!-- 套餐--goods -->
</view>
<view class="goods-wrap" v-if="navIndex==3">
<!-- 优惠卷--goods -->
</view>
</div>
</view>
</template>
<script>
export default {
components:{
},
data() {
return {
navIndex: 0,
tabBars: [{
name: '',
id: 'guanzhu',
icon: require('../../../../static//images/groupBuyingList/tab_pintuan.png'),
active: require('../../../../static//images/groupBuyingList/tab_bottom_bg.png'),
}, {
name: '\xa0\xa0\xa0商品',
id: 'tuijian',
icon: require('../../../../static//images/groupBuyingList/tab_goods.png'),
active: require('../../../../static//images/groupBuyingList/tab_bottom_bg.png'),
}, {
name: '套餐',
id: 'tiyu',
icon: '',
active: require('../../../../static//images/groupBuyingList/tab_bottom_bg.png'),
},{
name: '优惠卷',
id: 'redian',
icon: '',
active: require('../../../../static//images/groupBuyingList/tab_bottom_bg.png'),
}],
}
},
methods: {
checkIndex(index) {
// console.log(index)
this.navIndex = index;
},
}
}
</script>
结束
Tamoxifen mediates its therapeutic effects through modulation of estrogen receptors ERs, leading to suppression of estrogen mediated cell proliferation buy priligy generic Even very experienced centres that optimally exploit corticosteroids at the earliest sign of pulmonary symptoms report a 5 toxic death rate Antman et al, 1992
They identified a set of 496 genes that demonstrated significantly greater variation between individual tumors than within paired tumor samples from the same individual can i buy priligy in mexico
That explains why cancer works by risk factors Priligy Hundreds of kilometers, but it takes several days blood pressure medication cough side effect amlodipine to walk in the central mountain range, There doesn t seem to be anything that took two blood pressure pills by accident can be called treasure does lemon juice lower blood pressure in an emergency in the Ruodao Grottoes, but Rogge doesn t believe this