tab栏 一行 放置多个


      <div  class="discover-secondTab" >
            <div v-for="(element,indexs) in 3" :key="indexs" class="stysecondTab">
                  <div  :class="{activeTab:curSecond==indexs}" @click="tabSecond(element,indexs)">
                    {{element.name}}
                </div>
            </div>
          </div>

css代码:

.discover-secondTab{
  overflow-X: scroll;
  white-space: nowrap;
}
.discover-secondTab::-webkit-scrollbar {
    /*滚动条整体样式*/
    width: 0;
    /*高宽分别对应横竖滚动条的尺寸*/
    height: 0;
  }
.stysecondTab{
  margin-top: 30px;
  margin-left: 20px;
  width: 80px;
  height: 30px;
  line-height: 30px;
  background-color: #f7f8fa;
  color: #323233;
  text-align: center;
  border-radius: 30px;
  display: inline-block;
  // width: auto;
}
.activeTab{
  background-color: #fde6e9;
  color: #D4342F;
  border-radius: 30px;
}

js代码:

data(){
     return{
        curSecond:0, 
     }
},
 methods: {
    // 二级标签点击
    tabSecond(item,index){
      this.curSecond = index
    },
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值