最近のプロジェクトにはタブ タブ バーが必要で、プロジェクトでは Vant Weapp コンポーネント ライブラリが使用されていますが、Vant のタブはプロジェクトの要件を満たしていません。したがって、カスタム コンポーネントが使用されます。
効果:
.wxml
<scroll-view class='component cus' scroll-x="{
{ isScroll }}">
<view class='content'>
<view class='item' data-cus="{
{ dataCus[index] }}" data-index="{
{ index }}" data-value="{
{ item }}" wx:for="{
{ items }}" wx:key="index" wx:for-item="item" style='min-width: {
{ itemWidth }}rpx; height: {
{ height }}rpx' catchtap='onItemTap'>
<text class='text' style='color: {
{ mSelected == index ? selectTextColor : textColor }};font-size: {
{ textTopSize }