mali-applet-ui 0.2.81 → 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.
@@ -104,7 +104,7 @@ export default {
104
104
  if (this.negative) {
105
105
  return -9999999999
106
106
  }
107
- return null
107
+ return 0
108
108
  },
109
109
  maxNum () {
110
110
  if (XEUtils.isNumber(this.max) || this.max) {
@@ -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="primary" @click="confirmEvent">{{ confirmButtonText }}</ml-button>
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: 20rpx;
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "0.2.81",
3
+ "version": "0.2.83",
4
4
  "description": "码里云小程序组件库",
5
5
  "scripts": {
6
6
  "release": "node script/release.js && npm publish"