mali-applet-ui 0.1.46 → 0.1.48
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-checkbox/ml-checkbox.vue +6 -0
- package/components/ml-checkbox-button/ml-checkbox-button.vue +7 -1
- package/components/ml-checkbox-group/ml-checkbox-group.vue +3 -0
- package/components/ml-drawer/ml-drawer.vue +4 -1
- package/components/ml-radio/ml-radio.vue +7 -0
- package/components/ml-radio-button/ml-radio-button.vue +7 -1
- package/components/ml-radio-group/ml-radio-group.vue +3 -0
- package/package.json +1 -1
|
@@ -39,6 +39,9 @@ export default {
|
|
|
39
39
|
},
|
|
40
40
|
methods: {
|
|
41
41
|
tapEvent () {
|
|
42
|
+
if (this.disabled) {
|
|
43
|
+
return
|
|
44
|
+
}
|
|
42
45
|
let value
|
|
43
46
|
if (this.label === null) {
|
|
44
47
|
value = !this.value
|
|
@@ -61,6 +64,9 @@ export default {
|
|
|
61
64
|
&.is-checked {
|
|
62
65
|
color: $uni-color-primary;
|
|
63
66
|
}
|
|
67
|
+
&.is-disabled {
|
|
68
|
+
color: rgba(0,0,0,0.25);
|
|
69
|
+
}
|
|
64
70
|
&.is-vertical {
|
|
65
71
|
.ml-checkbox-content {
|
|
66
72
|
flex-direction: column;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="ml-checkbox-button" :class="[className || '', {'is-disabled': disabled}]">
|
|
3
|
-
<view class="ml-checkbox-button-item" v-for="(item, index) in options" :class="{'is-active': value.includes(item.value)}" :key="index" @tap="changeEvent(item)">{{ item.label }}</view>
|
|
3
|
+
<view class="ml-checkbox-button-item" v-for="(item, index) in options" :class="{'is-disabled': disabled, 'is-active': value.includes(item.value)}" :key="index" @tap="changeEvent(item)">{{ item.label }}</view>
|
|
4
4
|
</view>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
@@ -18,6 +18,9 @@ export default {
|
|
|
18
18
|
},
|
|
19
19
|
methods: {
|
|
20
20
|
changeEvent (option) {
|
|
21
|
+
if (this.disabled) {
|
|
22
|
+
return
|
|
23
|
+
}
|
|
21
24
|
const checked = !this.value.includes(option.value)
|
|
22
25
|
let value = this.value.filter(val => val !== option.value)
|
|
23
26
|
if (checked) {
|
|
@@ -47,5 +50,8 @@ export default {
|
|
|
47
50
|
color: #ffffff;
|
|
48
51
|
background-color: $uni-color-primary;
|
|
49
52
|
}
|
|
53
|
+
&.is-disabled {
|
|
54
|
+
color: rgba(0,0,0,0.25);
|
|
55
|
+
}
|
|
50
56
|
}
|
|
51
57
|
</style>
|
|
@@ -23,6 +23,7 @@ export default {
|
|
|
23
23
|
type: [Boolean, Number, String],
|
|
24
24
|
default: false
|
|
25
25
|
},
|
|
26
|
+
vertical: Boolean,
|
|
26
27
|
disabled: Boolean,
|
|
27
28
|
content: String,
|
|
28
29
|
className: String
|
|
@@ -34,6 +35,9 @@ export default {
|
|
|
34
35
|
},
|
|
35
36
|
methods: {
|
|
36
37
|
tapEvent () {
|
|
38
|
+
if (this.disabled) {
|
|
39
|
+
return
|
|
40
|
+
}
|
|
37
41
|
const value = this.label
|
|
38
42
|
this.$emit('input', value)
|
|
39
43
|
this.$emit('change', { value, label: this.label, checked: this.checked })
|
|
@@ -51,6 +55,9 @@ export default {
|
|
|
51
55
|
&.is-checked {
|
|
52
56
|
color: $uni-color-primary;
|
|
53
57
|
}
|
|
58
|
+
&.is-disabled {
|
|
59
|
+
color: rgba(0,0,0,0.25);
|
|
60
|
+
}
|
|
54
61
|
&.is-vertical {
|
|
55
62
|
.ml-radio-content {
|
|
56
63
|
flex-direction: column;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="ml-radio-button" :class="[className || '', {'is-disabled': disabled}]">
|
|
3
|
-
<view class="ml-radio-button-item" v-for="(item, index) in options" :class="{'is-active': value === item.value}" :key="index" @tap="changeEvent(item)">{{ item.label }}</view>
|
|
3
|
+
<view class="ml-radio-button-item" v-for="(item, index) in options" :class="{'is-disabled': disabled, 'is-active': value === item.value}" :key="index" @tap="changeEvent(item)">{{ item.label }}</view>
|
|
4
4
|
</view>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
@@ -18,6 +18,9 @@ export default {
|
|
|
18
18
|
},
|
|
19
19
|
methods: {
|
|
20
20
|
changeEvent (option) {
|
|
21
|
+
if (this.disabled) {
|
|
22
|
+
return
|
|
23
|
+
}
|
|
21
24
|
const { value } = option
|
|
22
25
|
this.$emit('input', value)
|
|
23
26
|
this.$emit('change', { value, option })
|
|
@@ -43,5 +46,8 @@ export default {
|
|
|
43
46
|
color: #ffffff;
|
|
44
47
|
background-color: $uni-color-primary;
|
|
45
48
|
}
|
|
49
|
+
&.is-disabled {
|
|
50
|
+
color: rgba(0,0,0,0.25);
|
|
51
|
+
}
|
|
46
52
|
}
|
|
47
53
|
</style>
|