xuxueyang
2024-09-03 9cfb7141478e85dfc1367b6fb5f31852aa20c1d2
components/top-tabs.vue
@@ -1,5 +1,5 @@
<template>
  <view class="flex top-tabs">
   <view class="flex top-tabs" :class="[type]">
    <view class="top-tab t-grey p10" v-for="(item,index) of tabs" @tap="changeIndex(index)"
          :class="[''+index==flg?'active':'']">
      {{ item.name || item.label || '' }}
@@ -18,7 +18,8 @@
      type: Array,
      default: []
    },
    flg: ""
         flg: "",
         type: '',
  },
  methods: {
    changeIndex(index) {
@@ -34,7 +35,22 @@
}
</script>
<style lang="scss">
<style lang="scss" scoped>
   .top-tabs.coupon {
      .top-tab {
         color: var(----topicdarkgray);
      }
      .top-tab.active {
         color: var(--topicolor);
      }
      .top-tab.active::before {
         background: var(--topicolor);
         bottom: 0rpx;
      }
   }
.top-tabs {
  .top-tab {
    color: #ffffff;
@@ -50,7 +66,6 @@
    font-weight: 600;
    font-size: 36rpx;
    color: #ffffff;
    line-height: 32rpx;
    text-align: center;
    font-style: normal;