mali-applet-ui 0.2.60 → 0.2.61
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<view class="ml-tabs-header">
|
|
4
4
|
<scroll-view scroll-x>
|
|
5
5
|
<view class="ml-tabs-navs" :class="[itemAlign ? `is-${itemAlign}` : '']">
|
|
6
|
-
<view class="ml-tabs-nav-item" v-for="(item, index) in tabList" :key="index" :class="{'is-active': value === item.name}" :style="
|
|
6
|
+
<view class="ml-tabs-nav-item" v-for="(item, index) in tabList" :key="index" :class="{'is-active': value === item.name}" :style="item.width ? `width:${item.itemWidth};` : itemStyles" @tap="changeEvent(item)">
|
|
7
7
|
<view class="ml-tabs-nav-title">{{ item.title }}</view>
|
|
8
8
|
<view v-if="item.showDot && item.dotNum > 0" class="ml-tabs-nav-title-dot-num" :class="[item.dotStatus ? `s-${item.dotStatus}` : '']">{{ getDotNum(item.dotNum) }}</view>
|
|
9
9
|
<view v-else-if="item.showDot" class="ml-tabs-nav-title-dot" :class="[item.dotStatus ? `s-${item.dotStatus}` : '']"></view>
|
|
@@ -26,7 +26,7 @@ export default {
|
|
|
26
26
|
itemAlign: String,
|
|
27
27
|
itemWidth: String
|
|
28
28
|
},
|
|
29
|
-
provide() {
|
|
29
|
+
provide () {
|
|
30
30
|
return {
|
|
31
31
|
mlTabs: this
|
|
32
32
|
}
|
|
@@ -36,13 +36,12 @@ export default {
|
|
|
36
36
|
tabList: []
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (item.width) {
|
|
42
|
-
return `width:${item.itemWidth};`
|
|
43
|
-
}
|
|
39
|
+
computed: {
|
|
40
|
+
itemStyles () {
|
|
44
41
|
return this.itemWidth ? `width:${this.itemWidth};` : ''
|
|
45
|
-
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
46
45
|
getDotNum (num) {
|
|
47
46
|
return num > 99 ? '99+' : num
|
|
48
47
|
},
|
|
@@ -59,7 +58,7 @@ export default {
|
|
|
59
58
|
.ml-tabs {
|
|
60
59
|
display: flex;
|
|
61
60
|
flex-direction: column;
|
|
62
|
-
|
|
61
|
+
font-size: $uni-font-size-base;
|
|
63
62
|
.ml-tabs-navs {
|
|
64
63
|
flex-shrink: 0;
|
|
65
64
|
white-space: nowrap;
|
|
@@ -159,4 +158,4 @@ export default {
|
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
|
-
</style>
|
|
161
|
+
</style>
|