mali-applet-ui 0.0.90 → 0.0.91
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.
- package/components/ml-dict-type/ml-dict-type.vue +30 -1
- package/components/ml-list-item/ml-list-item.vue +6 -0
- package/components/ml-list-menu-group/ml-list-menu-group.vue +3 -0
- package/components/ml-list-menu-item/ml-list-menu-item.vue +21 -1
- package/components/ml-row/ml-row.vue +17 -1
- package/components/ml-tabs/ml-tabs.vue +12 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<text class="ml-dict-type" :class="[className || '', (status || showStatus) && selectStatus ? `status-${selectStatus}` : '', {'is-underline': underline, 'is-round': round}]">{{ selectLabel }}</text>
|
|
2
|
+
<text class="ml-dict-type" :class="[className || '', (status || showStatus) && selectStatus ? `status-${selectStatus}` : '', {'is-underline': underline, 'is-border': border, 'is-round': round}]">{{ selectLabel }}</text>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
@@ -13,6 +13,7 @@ export default {
|
|
|
13
13
|
options: Array,
|
|
14
14
|
status: String,
|
|
15
15
|
round: Boolean,
|
|
16
|
+
border: Boolean,
|
|
16
17
|
showStatus: Boolean,
|
|
17
18
|
underline: Boolean,
|
|
18
19
|
optionProps: Object,
|
|
@@ -48,9 +49,37 @@ export default {
|
|
|
48
49
|
<style lang="scss">
|
|
49
50
|
.ml-dict-type {
|
|
50
51
|
padding: 0 4rpx;
|
|
52
|
+
&+.ml-dict-type {
|
|
53
|
+
margin-left: 20rpx;
|
|
54
|
+
}
|
|
51
55
|
&.is-underline {
|
|
52
56
|
text-decoration: underline;
|
|
53
57
|
}
|
|
58
|
+
&.is-border {
|
|
59
|
+
padding: 6rpx 16rpx;
|
|
60
|
+
border-radius: 10rpx;
|
|
61
|
+
font-size: 20rpx;
|
|
62
|
+
&.status-primary {
|
|
63
|
+
color: $uni-color-primary;
|
|
64
|
+
border: 1px solid $uni-color-primary;
|
|
65
|
+
}
|
|
66
|
+
&.status-success {
|
|
67
|
+
color: $uni-color-success;
|
|
68
|
+
border: 1px solid $uni-color-success;
|
|
69
|
+
}
|
|
70
|
+
&.status-info {
|
|
71
|
+
color: #909399;
|
|
72
|
+
border: 1px solid #909399;
|
|
73
|
+
}
|
|
74
|
+
&.status-warning {
|
|
75
|
+
color: $uni-color-warning;
|
|
76
|
+
border: 1px solid $uni-color-warning;
|
|
77
|
+
}
|
|
78
|
+
&.status-danger {
|
|
79
|
+
color: $uni-color-error;
|
|
80
|
+
border: 1px solid $uni-color-error;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
54
83
|
&.is-round {
|
|
55
84
|
padding: 6rpx 16rpx;
|
|
56
85
|
border-radius: 10rpx;
|
|
@@ -22,6 +22,7 @@ export default {
|
|
|
22
22
|
},
|
|
23
23
|
props: {
|
|
24
24
|
name: String,
|
|
25
|
+
vertical: Boolean,
|
|
25
26
|
prefixIcon: String,
|
|
26
27
|
suffixIcon: {
|
|
27
28
|
type: String,
|
|
@@ -31,6 +32,11 @@ export default {
|
|
|
31
32
|
redirect: Boolean,
|
|
32
33
|
className: String
|
|
33
34
|
},
|
|
35
|
+
provide() {
|
|
36
|
+
return {
|
|
37
|
+
mlListMenu: this
|
|
38
|
+
}
|
|
39
|
+
},
|
|
34
40
|
methods: {
|
|
35
41
|
clickEvent () {
|
|
36
42
|
this.$emit('click', {})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-list-menu-item" :class="className" @click="clickEvent" @tap="tapEvent">
|
|
2
|
+
<view class="ml-list-menu-item" :class="[className || '', {'is-vertical': itemVertical}]" @click="clickEvent" @tap="tapEvent">
|
|
3
3
|
<view v-if="prefixIcon && prefixIcon !== 'none'" class="ml-list-menu-item-left-icon">
|
|
4
4
|
<ml-icon :className="prefixIcon"></ml-icon>
|
|
5
5
|
</view>
|
|
@@ -25,6 +25,7 @@ export default {
|
|
|
25
25
|
},
|
|
26
26
|
props: {
|
|
27
27
|
name: String,
|
|
28
|
+
vertical: Boolean,
|
|
28
29
|
prefixIcon: String,
|
|
29
30
|
suffixIcon: {
|
|
30
31
|
type: String,
|
|
@@ -37,6 +38,20 @@ export default {
|
|
|
37
38
|
dotStatus: String,
|
|
38
39
|
dotNum: [String, Number]
|
|
39
40
|
},
|
|
41
|
+
inject: {
|
|
42
|
+
listMenu: {
|
|
43
|
+
from: 'mlListMenu',
|
|
44
|
+
default: null
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
computed: {
|
|
48
|
+
itemVertical () {
|
|
49
|
+
if (this.vertical) {
|
|
50
|
+
return true
|
|
51
|
+
}
|
|
52
|
+
return this.listMenu ? this.listMenu.vertical : false
|
|
53
|
+
}
|
|
54
|
+
},
|
|
40
55
|
methods: {
|
|
41
56
|
getDotNum (num) {
|
|
42
57
|
return num > 99 ? '99+' : num
|
|
@@ -82,6 +97,11 @@ export default {
|
|
|
82
97
|
text-overflow: ellipsis;
|
|
83
98
|
white-space: nowrap;
|
|
84
99
|
}
|
|
100
|
+
&.is-vertical {
|
|
101
|
+
.ml-list-menu-item-content {
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
85
105
|
.ml-list-menu-item-dot {
|
|
86
106
|
position: relative;
|
|
87
107
|
flex-shrink: 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="ml-row" :class="[className || '', {'is-vertical': vertical}]">
|
|
2
|
+
<view class="ml-row" :class="[className || '', status ? `status-${status}` : '', {'is-vertical': vertical}]">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</view>
|
|
5
5
|
</template>
|
|
@@ -12,6 +12,7 @@ export default {
|
|
|
12
12
|
},
|
|
13
13
|
props: {
|
|
14
14
|
vertical: Boolean,
|
|
15
|
+
status: String,
|
|
15
16
|
className: String
|
|
16
17
|
}
|
|
17
18
|
}
|
|
@@ -25,5 +26,20 @@ export default {
|
|
|
25
26
|
&.is-vertical {
|
|
26
27
|
flex-direction: column;
|
|
27
28
|
}
|
|
29
|
+
&.status-primary {
|
|
30
|
+
color: $uni-color-primary;
|
|
31
|
+
}
|
|
32
|
+
&.status-success {
|
|
33
|
+
color: $uni-color-success;
|
|
34
|
+
}
|
|
35
|
+
&.status-info {
|
|
36
|
+
color: #909399;
|
|
37
|
+
}
|
|
38
|
+
&.status-warning {
|
|
39
|
+
color: $uni-color-warning;
|
|
40
|
+
}
|
|
41
|
+
&.status-danger {
|
|
42
|
+
color: $uni-color-error;
|
|
43
|
+
}
|
|
28
44
|
}
|
|
29
45
|
</style>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<view class="ml-tabs" :class="[className || '']">
|
|
3
3
|
<view class="ml-tabs-header">
|
|
4
4
|
<scroll-view scroll-x>
|
|
5
|
-
<view class="ml-tabs-navs">
|
|
5
|
+
<view class="ml-tabs-navs" :class="[itemAlign ? `is-${itemAlign}` : '']">
|
|
6
6
|
<view class="ml-tabs-nav-item" v-for="(item, index) in options" :key="index" :class="{'is-active': value === item.value}" :style="itemStyles" @tap="changeEvent(item)">
|
|
7
7
|
<view class="ml-tabs-nav-title">{{ item.label }}</view>
|
|
8
8
|
</view>
|
|
@@ -24,6 +24,7 @@ export default {
|
|
|
24
24
|
value: [String, Number],
|
|
25
25
|
options: Array,
|
|
26
26
|
className: String,
|
|
27
|
+
itemAlign: String,
|
|
27
28
|
itemWidth: String
|
|
28
29
|
},
|
|
29
30
|
provide() {
|
|
@@ -51,8 +52,18 @@ export default {
|
|
|
51
52
|
|
|
52
53
|
<style lang="scss">
|
|
53
54
|
.ml-tabs {
|
|
55
|
+
font-size: $uni-font-size-base;
|
|
54
56
|
.ml-tabs-navs {
|
|
55
57
|
white-space: nowrap;
|
|
58
|
+
&.is-left {
|
|
59
|
+
text-align: left;
|
|
60
|
+
}
|
|
61
|
+
&.is-center {
|
|
62
|
+
text-align: center;
|
|
63
|
+
}
|
|
64
|
+
&.is-right {
|
|
65
|
+
text-align: right;
|
|
66
|
+
}
|
|
56
67
|
}
|
|
57
68
|
.ml-tabs-header {
|
|
58
69
|
background: #fff;
|