mali-applet-ui 0.2.59 → 0.2.60
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.
|
@@ -18,6 +18,7 @@ export default {
|
|
|
18
18
|
showDot: Boolean,
|
|
19
19
|
dotStatus: String,
|
|
20
20
|
dotNum: [String, Number],
|
|
21
|
+
width: [String, Number],
|
|
21
22
|
className: String
|
|
22
23
|
},
|
|
23
24
|
inject: {
|
|
@@ -46,6 +47,9 @@ export default {
|
|
|
46
47
|
},
|
|
47
48
|
dotNum () {
|
|
48
49
|
this.updateProp('dotNum')
|
|
50
|
+
},
|
|
51
|
+
width() {
|
|
52
|
+
this.updateProp('width')
|
|
49
53
|
}
|
|
50
54
|
},
|
|
51
55
|
mounted () {
|
|
@@ -57,7 +61,8 @@ export default {
|
|
|
57
61
|
title: this.title,
|
|
58
62
|
showDot: this.showDot,
|
|
59
63
|
dotStatus: this.dotStatus,
|
|
60
|
-
dotNum: this.dotNum
|
|
64
|
+
dotNum: this.dotNum,
|
|
65
|
+
width: this.width
|
|
61
66
|
})
|
|
62
67
|
}
|
|
63
68
|
})
|
|
@@ -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="getItemStyles(item)" @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>
|
|
@@ -36,12 +36,13 @@ export default {
|
|
|
36
36
|
tabList: []
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
computed: {
|
|
40
|
-
itemStyles () {
|
|
41
|
-
return this.itemWidth ? `width:${this.itemWidth};` : ''
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
39
|
methods: {
|
|
40
|
+
getItemStyles (item) {
|
|
41
|
+
if (item.width) {
|
|
42
|
+
return `width:${item.itemWidth};`
|
|
43
|
+
}
|
|
44
|
+
return this.itemWidth ? `width:${this.itemWidth};` : ''
|
|
45
|
+
},
|
|
45
46
|
getDotNum (num) {
|
|
46
47
|
return num > 99 ? '99+' : num
|
|
47
48
|
},
|
package/package.json
CHANGED
package/utils/applet.js
CHANGED
|
@@ -10,16 +10,12 @@ export function getPlatformEnv () {
|
|
|
10
10
|
isQWH5: false,
|
|
11
11
|
isDDH5: false,
|
|
12
12
|
// 微信
|
|
13
|
-
isWX: false,
|
|
14
13
|
isWXMP: false,
|
|
15
14
|
// 企业微信
|
|
16
|
-
isQW: false,
|
|
17
15
|
isQWMP: false,
|
|
18
16
|
// 钉钉
|
|
19
|
-
isDD: false,
|
|
20
17
|
isDDMP: false,
|
|
21
18
|
// 支付宝
|
|
22
|
-
isZFB: false,
|
|
23
19
|
isZFBMP: false
|
|
24
20
|
}
|
|
25
21
|
if (/web/.test(sysRes.uniPlatform)) {
|