sadais-piui 1.2.7-beta87 → 1.2.7-beta88

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.
@@ -28,7 +28,7 @@
28
28
  <!-- 顶部面包屑 -->
29
29
  <scroll-view class="node-breadcrumb pi-solid-bottom-1" scroll-x>
30
30
  <view
31
- v-for="(item, index) in allPathItems"
31
+ v-for="(item, index) in pathItems"
32
32
  :key="index"
33
33
  class="breadcrumb-item"
34
34
  @click="handleClickItem(item)"
@@ -117,18 +117,13 @@
117
117
  style="flex: 1;padding-left: 0;overflow: hidden;"
118
118
  >
119
119
  <view
120
- v-for="(item, index) in pathItems"
120
+ v-for="(item, index) in currentPathItems"
121
121
  :key="index"
122
122
  class="breadcrumb-item"
123
123
  @click="handleClickItem(item)"
124
124
  >
125
125
  <pi-icon v-if="index > 0" name="right" custom-class="pi-mg-lr-6" />
126
- <view
127
- class="breadcrumb-item-title"
128
- :class="{
129
- active: currentItem && currentItem[keyField] === item[keyField]
130
- }"
131
- >
126
+ <view class="breadcrumb-item-title">
132
127
  {{ item[displayField] }}
133
128
  </view>
134
129
  </view>
@@ -328,15 +323,24 @@ export default {
328
323
  p = this.itemsMap[p.pid]
329
324
  }
330
325
  }
331
- return pathItems
332
- },
333
- allPathItems() {
334
326
  return [
335
327
  {
336
328
  [this.displayField]: '全部',
337
329
  [this.keyField]: 'ROOT'
338
330
  }
339
- ].concat(this.pathItems)
331
+ ].concat(pathItems)
332
+ },
333
+ currentPathItems() {
334
+ const pathItems = []
335
+ if (this.isSingle) {
336
+ // 往上找构建完整路径
337
+ let p = this.itemsMap[this.selectedIds[0]]
338
+ while (p) {
339
+ pathItems.unshift(p)
340
+ p = this.itemsMap[p.pid]
341
+ }
342
+ }
343
+ return pathItems
340
344
  }
341
345
  },
342
346
  watch: {
@@ -521,10 +525,10 @@ export default {
521
525
  }
522
526
  .column-item {
523
527
  position: relative;
524
- height: 100rpx;
528
+ min-height: 100rpx;
525
529
  width: 100%;
526
530
  white-space: initial;
527
- padding: 0 16rpx 0 32rpx;
531
+ padding: 16rpx 32rpx;
528
532
  font-size: 28rpx;
529
533
  color: #333333;
530
534
  overflow: hidden;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta87",
3
+ "version": "1.2.7-beta88",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {