vue2-client 1.18.67 → 1.18.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,16 +42,21 @@
42
42
  height: item.indicatorHeight || '16px'
43
43
  }"
44
44
  ></div>
45
+ <div
46
+ v-if="isTabStyle"
47
+ class="x-radio-tab-icon"
48
+ :class="{ 'x-radio-tab-icon-active': innerValue === item.value }"
49
+ ></div>
45
50
  <a-radio
46
51
  :value="item.value"
47
52
  class="x-radio-item"
48
- :class="{ 'x-radio-item-no-dot': config.highlightBorder }"
53
+ :class="{ 'x-radio-item-no-dot': config.highlightBorder || isTabStyle }"
49
54
  >
50
55
  {{ item.label }}
51
56
  </a-radio>
52
57
  </div>
53
58
  <div
54
- v-if="config.showIndicator && item.bottomLine !== false && !config.showBorder && !config.highlightBorder"
59
+ v-if="config.showIndicator && item.bottomLine !== false && !config.showBorder && !config.highlightBorder && !isTabStyle"
55
60
  class="x-radio-indicator-bottom"
56
61
  :style="{
57
62
  width: item.indicatorWidth || '100%',
@@ -59,6 +64,10 @@
59
64
  height: config.indicatorHeight + 'px'
60
65
  }"
61
66
  ></div>
67
+ <div
68
+ v-if="isTabStyle && innerValue === item.value"
69
+ class="x-radio-tab-underline"
70
+ ></div>
62
71
  </div>
63
72
  </a-radio-group>
64
73
  </div>
@@ -101,6 +110,12 @@
101
110
  this.innerValue = val
102
111
  }
103
112
  },
113
+ computed: {
114
+ isTabStyle () {
115
+ const val = this.$attrs && this.$attrs['tab-style']
116
+ return val === true || val === '' || val === 'true'
117
+ }
118
+ },
104
119
  emits: ['change', 'init'],
105
120
  methods: {
106
121
  async getData (data) {
@@ -158,7 +173,7 @@
158
173
  const attrs = this.$attrs || {}
159
174
  const classes = {}
160
175
  const booleanStyleKeys = [
161
- 'item-0padding', 'compact', 'out-radio', 'distributed'
176
+ 'item-0padding', 'compact', 'out-radio', 'distributed', 'tab-style'
162
177
  ]
163
178
  booleanStyleKeys.forEach(key => {
164
179
  const val = attrs[key]
@@ -550,4 +565,69 @@
550
565
  /* 改为内容自适应宽度,父容器使用 space-between 保证等距 */
551
566
  }
552
567
  }
568
+
569
+ /* 标签页样式:带圆形图标和下划线 */
570
+ .x-radio-tab-style {
571
+ &.x-radio-container,
572
+ .x-radio-container {
573
+ :deep(.x-radio-group) {
574
+ display: flex;
575
+ justify-content: flex-start;
576
+ align-items: center;
577
+ gap: 0;
578
+ flex-wrap: nowrap;
579
+ }
580
+ :deep(.x-radio-item-container) {
581
+ flex: none;
582
+ display: flex;
583
+ flex-direction: column;
584
+ align-items: center;
585
+ position: relative;
586
+ padding: 0;
587
+ margin-right: 0;
588
+ }
589
+ :deep(.x-radio-item-wrapper) {
590
+ display: flex;
591
+ align-items: center;
592
+ justify-content: center;
593
+ width: auto;
594
+ position: relative;
595
+ }
596
+ :deep(.x-radio-item) {
597
+ margin-bottom: 0;
598
+ display: none;
599
+ padding-left: 0;
600
+ display: flex;
601
+ align-items: center;
602
+ font-family: "Source Han Sans" !important;
603
+ font-size: 16px !important;
604
+ font-weight: bold !important;
605
+ color: #5D5C5C;
606
+ line-height: normal;
607
+ padding: 0;
608
+ margin: 0;
609
+ }
610
+ :deep(.x-radio-tab-icon) {
611
+ width: 12px;
612
+ height: 12px;
613
+ background-color: #0057FE;
614
+ border-radius: 50%;
615
+ margin-right: 8px;
616
+ flex-shrink: 0;
617
+ display: block;
618
+ }
619
+ :deep(.x-radio-tab-underline) {
620
+ position: absolute;
621
+ bottom: -8px;
622
+ left: 0;
623
+ right: 0;
624
+ height: 2px;
625
+ background-color: #0057FE;
626
+ border-radius: 2px;
627
+ }
628
+ :deep(.x-radio-item-container:not(:last-child)) {
629
+ margin-right: 12px;
630
+ }
631
+ }
632
+ }
553
633
  </style>