mali-applet-ui 1.1.63 → 1.1.64

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.
@@ -11,6 +11,9 @@
11
11
  <view v-if="clearable && !readonly && !hasEmpty" class="ml-list-select-page-clear-icon" @click.stop="clearEvent">
12
12
  <ml-icon name="delete-filling"></ml-icon>
13
13
  </view>
14
+ <view v-else-if="!readonly && showAddBtn" class="ml-list-select-page-add-item" @click="openEvent">
15
+ <ml-icon name="add-circle" />
16
+ </view>
14
17
  <view v-else-if="!readonly" class="ml-list-select-page-icon">
15
18
  <ml-icon name="arrow-right" />
16
19
  </view>
@@ -40,6 +43,7 @@ export default {
40
43
  type: String,
41
44
  default: '请选择'
42
45
  },
46
+ showAddBtn: Boolean,
43
47
  disabled: Boolean,
44
48
  readonly: Boolean,
45
49
  border: Boolean,
@@ -105,7 +109,22 @@ export default {
105
109
  }
106
110
  })
107
111
  },
112
+ remove (item) {
113
+ let value = null
114
+ if (this.type === 'checkbox') {
115
+ value = this.value.filter(key => key !== item[this.optValueField])
116
+ }
117
+ this.$emit('input', value)
118
+ },
108
119
  tapEvent () {
120
+ if (this.showAddBtn || this.disabled) {
121
+ return
122
+ }
123
+ this.openEvent()
124
+ this.$emit('tap', {})
125
+ this.$emit('click', {})
126
+ },
127
+ openEvent () {
109
128
  if (this.disabled) {
110
129
  return
111
130
  }
@@ -129,8 +148,6 @@ export default {
129
148
  }
130
149
  }
131
150
  })
132
- this.$emit('tap', {})
133
- this.$emit('click', {})
134
151
  },
135
152
  clearEvent () {
136
153
  let value = null
@@ -149,17 +166,27 @@ export default {
149
166
  display: flex;
150
167
  flex-direction: row;
151
168
  padding: 0 10rpx;
152
- height: 70rpx;
153
169
  line-height: 70rpx;
154
- &.is-disabled {
155
-
156
- }
157
170
  .ml-list-select-page-warpper {
158
171
  flex-grow: 1;
159
172
  overflow: hidden;
160
173
  text-overflow: ellipsis;
161
174
  white-space: nowrap;
162
175
  }
176
+ .ml-list-select-page-add-item {
177
+ position: absolute;
178
+ top: -74rpx;
179
+ right: 20rpx;
180
+ font-size: 44rpx;
181
+ }
182
+ &.is-disabled {
183
+ // #ifdef H5
184
+ cursor: pointer;
185
+ // #endif
186
+ .ml-list-select-page-add-item {
187
+ color: #c0c0c0;
188
+ }
189
+ }
163
190
  .ml-list-select-page-clear-icon,
164
191
  .ml-list-select-page-icon {
165
192
  flex-shrink: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.1.63",
3
+ "version": "1.1.64",
4
4
  "description": "码里UI-小程序组件库(vue2)",
5
5
  "files": [
6
6
  "lib",