mali-applet-ui 1.0.89 → 1.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.
@@ -242,9 +242,6 @@ export default {
242
242
  .ml-form-item-header-title {
243
243
  flex-grow: 1;
244
244
  color: #171A1D;
245
- overflow: hidden;
246
- text-overflow: ellipsis;
247
- white-space: nowrap;
248
245
  }
249
246
  .ml-form-item-header-extra {
250
247
  flex-shrink: 0;
@@ -78,6 +78,7 @@ export default {
78
78
  props: {
79
79
  value: [Array, String, Number],
80
80
  check: Boolean,
81
+ autoload: Boolean,
81
82
  height: [String, Number],
82
83
  multiple: Boolean,
83
84
  breadcrumb: Boolean,
@@ -162,31 +163,44 @@ export default {
162
163
  return `${height}rpx`
163
164
  }
164
165
  },
166
+ mounted () {
167
+ const { autoload, reloadLazy } = this
168
+ if (autoload) {
169
+ reloadLazy()
170
+ }
171
+ },
165
172
  methods: {
166
173
  async handleIntoChildren (item) {
167
- const { lazyLoad, lazy, current } = this
168
- if (!(item.children && item.children.length) && lazy && lazyLoad && !item.isLeaf) {
174
+ const { reloadLazy } = this
175
+ if (!(item.children && item.children.length) && !item.isLeaf) {
169
176
  // this.lazyLoading = true
170
- await lazyLoad.call(this.currVM, item)
177
+ await reloadLazy(item)
171
178
  // this.lazyLoading = false
172
179
  }
173
180
  if (item.children && item.children.length) {
174
181
  this.cache.push(item)
175
- this.$emit('into', current)
182
+ this.$emit('into', this.cache[this.cache.length - 1])
176
183
  }
177
184
  },
178
- async reloadLazy () {
179
- const { lazyLoad, lazy, current } = this
185
+ async reloadLazy (current) {
186
+ const { lazyLoad, lazy, useProps } = this
180
187
  if (lazy && lazyLoad) {
181
- // this.lazyLoading = true
182
- await lazyLoad.call(this.currVM, current)
183
- // this.lazyLoading = false
188
+ const list = await lazyLoad.call(this.currVM, current)
189
+ if (current) {
190
+ current[useProps.children] = list
191
+ } else {
192
+ this.$emit('update:tree', list)
193
+ }
184
194
  }
185
195
  },
186
196
  handleBack () {
187
- const { cache, current } = this
197
+ const { cache } = this
188
198
  cache.splice(cache.length - 1, 1)
189
- this.$emit('back', current)
199
+ if (cache.length) {
200
+ this.$emit('back', cache[cache.length - 1])
201
+ } else {
202
+ this.$emit('back')
203
+ }
190
204
  },
191
205
  handleToBreadcrumb (index) {
192
206
  const { cache } = this
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.0.89",
3
+ "version": "1.0.91",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",