mali-applet-ui 0.2.82 → 0.2.83
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.
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
</view>
|
|
14
14
|
<view v-if="showConfirmButton || showCancelButton || showFooter" class="ml-drawer-footer">
|
|
15
15
|
<slot name="footer">
|
|
16
|
-
<ml-button v-if="showCancelButton" @click="cancelEvent">{{ cancelButtonText }}</ml-button>
|
|
17
|
-
<ml-button v-if="showConfirmButton" status="
|
|
16
|
+
<ml-button v-if="showCancelButton" :status="cancelButtonStatus" @click="cancelEvent">{{ cancelButtonText }}</ml-button>
|
|
17
|
+
<ml-button v-if="showConfirmButton" :status="confirmButtonStatus" @click="confirmEvent">{{ confirmButtonText }}</ml-button>
|
|
18
18
|
</slot>
|
|
19
19
|
</view>
|
|
20
20
|
</view>
|
|
@@ -40,12 +40,17 @@ export default {
|
|
|
40
40
|
default: true
|
|
41
41
|
},
|
|
42
42
|
showConfirmButton: Boolean,
|
|
43
|
+
confirmButtonStatus: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: 'primary'
|
|
46
|
+
},
|
|
43
47
|
confirmButtonText: {
|
|
44
48
|
type: String,
|
|
45
49
|
default: '确认'
|
|
46
50
|
},
|
|
47
51
|
confirmClosable: Boolean,
|
|
48
52
|
showCancelButton: Boolean,
|
|
53
|
+
cancelButtonStatus: String,
|
|
49
54
|
cancelButtonText: {
|
|
50
55
|
type: String,
|
|
51
56
|
default: '取消'
|
|
@@ -173,7 +178,7 @@ export default {
|
|
|
173
178
|
position: absolute;
|
|
174
179
|
bottom: 0;
|
|
175
180
|
left: 0;
|
|
176
|
-
padding-bottom:
|
|
181
|
+
padding-bottom: 30rpx;
|
|
177
182
|
background: #fff;
|
|
178
183
|
transition: transform 0.25s ease, transform 0.3s ease;
|
|
179
184
|
}
|
|
@@ -37,6 +37,7 @@ export default {
|
|
|
37
37
|
title: String,
|
|
38
38
|
field: String,
|
|
39
39
|
align: String,
|
|
40
|
+
required: Boolean,
|
|
40
41
|
titleAlign: String,
|
|
41
42
|
vertical: Boolean,
|
|
42
43
|
labelWidth: String,
|
|
@@ -59,36 +60,6 @@ export default {
|
|
|
59
60
|
mId: XEUtils.uniqueId('mlFItem')
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
|
-
watch: {
|
|
63
|
-
title () {
|
|
64
|
-
this.updateProp('title')
|
|
65
|
-
},
|
|
66
|
-
field () {
|
|
67
|
-
this.updateProp('field')
|
|
68
|
-
},
|
|
69
|
-
itemValue () {
|
|
70
|
-
if (this.form) {
|
|
71
|
-
this.form.validateField(this.field)
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
mounted () {
|
|
76
|
-
this.$nextTick(() => {
|
|
77
|
-
if (this.form) {
|
|
78
|
-
this.form.itemList.push({
|
|
79
|
-
mId: this.mId,
|
|
80
|
-
title: this.title,
|
|
81
|
-
field: this.field,
|
|
82
|
-
errRule: null
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
},
|
|
87
|
-
beforeDestroy () {
|
|
88
|
-
if (this.form) {
|
|
89
|
-
XEUtils.remove(this.form.itemList, item => item.mId === this.mId)
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
63
|
computed: {
|
|
93
64
|
titleStyle () {
|
|
94
65
|
return this.itemLabelWidth ? `width:${this.itemLabelWidth};` : ''
|
|
@@ -97,6 +68,9 @@ export default {
|
|
|
97
68
|
return this.form ? this.form.border : false
|
|
98
69
|
},
|
|
99
70
|
isRequired () {
|
|
71
|
+
if (this.required) {
|
|
72
|
+
return true
|
|
73
|
+
}
|
|
100
74
|
if (this.form && this.form.rules) {
|
|
101
75
|
const currRules = this.form.rules[this.field]
|
|
102
76
|
if (currRules && currRules.some(item => item.required)) {
|
|
@@ -151,6 +125,36 @@ export default {
|
|
|
151
125
|
return labelWidth
|
|
152
126
|
}
|
|
153
127
|
},
|
|
128
|
+
watch: {
|
|
129
|
+
title () {
|
|
130
|
+
this.updateProp('title')
|
|
131
|
+
},
|
|
132
|
+
field () {
|
|
133
|
+
this.updateProp('field')
|
|
134
|
+
},
|
|
135
|
+
itemValue () {
|
|
136
|
+
if (this.form) {
|
|
137
|
+
this.form.validateField(this.field)
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
mounted () {
|
|
142
|
+
this.$nextTick(() => {
|
|
143
|
+
if (this.form) {
|
|
144
|
+
this.form.itemList.push({
|
|
145
|
+
mId: this.mId,
|
|
146
|
+
title: this.title,
|
|
147
|
+
field: this.field,
|
|
148
|
+
errRule: null
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
})
|
|
152
|
+
},
|
|
153
|
+
beforeDestroy () {
|
|
154
|
+
if (this.form) {
|
|
155
|
+
XEUtils.remove(this.form.itemList, item => item.mId === this.mId)
|
|
156
|
+
}
|
|
157
|
+
},
|
|
154
158
|
methods: {
|
|
155
159
|
updateProp (prop) {
|
|
156
160
|
if (this.form) {
|