mali-applet-ui 1.0.74 → 1.0.75

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.
@@ -8,6 +8,9 @@
8
8
  <view class="ml-form-item-header-title">
9
9
  <slot name="title">{{ title }}</slot>
10
10
  </view>
11
+ <view class="ml-form-item-header-extra">
12
+ <slot name="extra"></slot>
13
+ </view>
11
14
  </view>
12
15
  <view class="ml-form-item-content">
13
16
  <view class="ml-form-item-content-warpper">
@@ -223,10 +226,13 @@ export default {
223
226
  }
224
227
  }
225
228
  .ml-form-item-header {
229
+ display: flex;
230
+ flex-direction: row;
226
231
  min-height: 78rpx;
227
232
  padding: 0 10rpx;
228
233
  }
229
234
  .ml-form-item-header-asterisk {
235
+ flex-shrink: 0;
230
236
  position: absolute;
231
237
  left: 10rpx;
232
238
  color: red;
@@ -234,8 +240,14 @@ export default {
234
240
  padding-top: 10rpx;
235
241
  }
236
242
  .ml-form-item-header-title {
237
- display: inline;
243
+ flex-grow: 1;
238
244
  color: #171A1D;
245
+ overflow: hidden;
246
+ text-overflow: ellipsis;
247
+ white-space: nowrap;
248
+ }
249
+ .ml-form-item-header-extra {
250
+ flex-shrink: 0;
239
251
  }
240
252
  &.is-vertical {
241
253
  flex-direction: column;
@@ -1,16 +1,18 @@
1
1
  <template>
2
2
  <view class="ml-tree-box">
3
3
  <view class="ml-tree-tool">
4
- <view class="ml-tree-breadcrumb" v-if="breadcrumb">
5
- <view class="breadcrumb-item" @click="handleToBreadcrumb()">
6
- 全部
7
- <ml-icon v-if="cache && cache.length" name="arrow-right"></ml-icon>
4
+ <scroll-view :scroll-x="true" class="ml-tree-breadcrumb-scroll" v-if="breadcrumb">
5
+ <view class="ml-tree-breadcrumb">
6
+ <view class="breadcrumb-item" @click="handleToBreadcrumb()">
7
+ <text class="breadcrumb-text">全部</text>
8
+ <ml-icon v-if="cache && cache.length" name="arrow-right"></ml-icon>
9
+ </view>
10
+ <view class="breadcrumb-item" v-for="(item, index) in cache" :key="index" @click="handleToBreadcrumb(index)">
11
+ <text class="breadcrumb-text">{{ item[useProps.label] || '' }}</text>
12
+ <ml-icon v-if="index !== (cache.length - 1)" name="arrow-right"></ml-icon>
13
+ </view>
8
14
  </view>
9
- <view class="breadcrumb-item" v-for="(item, index) in cache" :key="index" @click="handleToBreadcrumb(index)">
10
- {{ item[useProps.label] || '' }}
11
- <ml-icon v-if="index !== (cache.length - 1)" name="arrow-right"></ml-icon>
12
- </view>
13
- </view>
15
+ </scroll-view>
14
16
  </view>
15
17
  <view class="ml-tree-content">
16
18
  <view class="ml-tree-node" v-if="cache && cache.length" @click="handleBack">
@@ -98,6 +100,12 @@ export default {
98
100
  }
99
101
  }
100
102
  },
103
+ inject: {
104
+ currVM: {
105
+ from: '$pageVM',
106
+ default: null
107
+ }
108
+ },
101
109
  computed: {
102
110
  showTree () {
103
111
  const { current, tree } = this
@@ -120,9 +128,10 @@ export default {
120
128
  methods: {
121
129
  async handleIntoChildren (item) {
122
130
  const { lazyLoad, lazy } = this
123
- if (!(item.children && item.children) && lazy && lazyLoad && !item.isLeaf) {
131
+ console.log(this)
132
+ if (!(item.children && item.children.length) && lazy && lazyLoad && !item.isLeaf) {
124
133
  // this.lazyLoading = true
125
- await lazyLoad(item)
134
+ await lazyLoad.call(this.currVM, item)
126
135
  // this.lazyLoading = false
127
136
  }
128
137
  if (item.children && item.children.length) {
@@ -133,7 +142,7 @@ export default {
133
142
  const { lazyLoad, lazy, current } = this
134
143
  if (lazy && lazyLoad) {
135
144
  // this.lazyLoading = true
136
- await lazyLoad(current)
145
+ await lazyLoad.call(this.currVM, current)
137
146
  // this.lazyLoading = false
138
147
  }
139
148
  },
@@ -351,10 +360,13 @@ export default {
351
360
  }
352
361
 
353
362
  .ml-tree-tool {
363
+ .ml-tree-breadcrumb-scroll {
364
+ background-color: #f3f3f3;
365
+ }
354
366
  .ml-tree-breadcrumb {
355
367
  display: flex;
356
- background-color: #f3f3f3;
357
368
  padding: 0 30rpx;
369
+ align-items: center;
358
370
 
359
371
  .breadcrumb-item {
360
372
  position: relative;
@@ -362,6 +374,14 @@ export default {
362
374
  line-height: 50rpx;
363
375
  color: #afafaf;
364
376
  font-size: 26rpx;
377
+ display: flex;
378
+ align-items: center;
379
+ .breadcrumb-text {
380
+ max-width: 220rpx;
381
+ overflow: hidden;
382
+ text-overflow: ellipsis;
383
+ white-space: nowrap;
384
+ }
365
385
 
366
386
  &:last-child {
367
387
  color: #6e6e6e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.0.74",
3
+ "version": "1.0.75",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",