sadais-piui 1.2.7-beta28 → 1.2.7-beta30

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.
@@ -7,6 +7,7 @@
7
7
  :show-slider-bar="false"
8
8
  show-item-split-line
9
9
  :stretch="stretch"
10
+ :height="tabHeight"
10
11
  active-text-color="inherit"
11
12
  >
12
13
  <!-- 注意:slot内不能使用父组件data -->
@@ -14,6 +15,7 @@
14
15
  slot="item"
15
16
  slot-scope="{ item, index }"
16
17
  :item="item"
18
+ class="pi-w-100P pi-h-100P"
17
19
  @click="handleClickTab(item, index)"
18
20
  />
19
21
  </pi-tabs>
@@ -128,6 +130,22 @@ export default {
128
130
  return dropdown.activeColor
129
131
  }
130
132
  },
133
+ // 标签是否均分布局,可选值 `true`
134
+ stretch: {
135
+ type: Boolean,
136
+ // `false`
137
+ default() {
138
+ return dropdown.stretch
139
+ }
140
+ },
141
+ // 标签的高度,单位rpx
142
+ tabHeight: {
143
+ type: [String, Number],
144
+ // `80`
145
+ default() {
146
+ return dropdown.tabHeight
147
+ }
148
+ },
131
149
  // -------------以下属性为子组件pi-dropdown-item继承用--------------
132
150
  // 行高 值为数字,则单位默认rpx
133
151
  itemHeight: {
@@ -169,14 +187,6 @@ export default {
169
187
  return dropdown.selectedCheckbox
170
188
  }
171
189
  },
172
- // 标签是否均分布局,可选值 `true`
173
- stretch: {
174
- type: Boolean,
175
- // `false`
176
- default() {
177
- return dropdown.stretch
178
- }
179
- },
180
190
  // 是否需要蒙层顶部对齐组件,可选值 `false`
181
191
  maskAlignTop: {
182
192
  type: Boolean,
@@ -39,8 +39,12 @@
39
39
  >
40
40
  <!-- 自定义列表项 -->
41
41
  <slot name="item" :item="item" :selected="item.isSelected" class="pi-w-100P">
42
- <!-- item[displayField] -->
43
- {{ item[displayField] }}
42
+ <view>
43
+ <view class="select-item-title">{{ item[displayField] }}</view>
44
+ <view v-if="item[descField]" class="pi-light-gray pi-fz-24 pi-mg-top-10 pi-lh-30">
45
+ {{ item[descField] }}
46
+ </view>
47
+ </view>
44
48
  </slot>
45
49
  <!-- 如果配置了图片地址,使用图片 -->
46
50
  <pi-img
@@ -60,7 +64,7 @@
60
64
  :loading-size="getSelectedImg.loadingSize"
61
65
  :show-error="getSelectedImg.showError"
62
66
  :webp="getSelectedImg.webp"
63
- custom-class="pi-mg-left-24"
67
+ custom-class="pi-mg-left-32"
64
68
  />
65
69
  <!-- 默认使用复选框 -->
66
70
  <pi-checkbox
@@ -76,7 +80,7 @@
76
80
  :icon-size="getSelectedCheckbox.iconSize"
77
81
  :active-color="getSelectedCheckbox.activeColor"
78
82
  :active-mode="getSelectedCheckbox.activeMode"
79
- custom-class="pi-mg-left-24"
83
+ custom-class="pi-mg-left-32"
80
84
  />
81
85
  </view>
82
86
  </scroll-view>
@@ -137,6 +141,12 @@ export default {
137
141
  // 'text'
138
142
  default: select.displayField
139
143
  },
144
+ // 描述显示字段,默认为desc
145
+ descField: {
146
+ type: String,
147
+ // 'desc'
148
+ default: select.descField
149
+ },
140
150
  // 默认值,单选是传Number, String, Object,多选时传Array
141
151
  defaultValue: {
142
152
  type: [Number, String, Object, Array],
@@ -359,7 +359,6 @@ export default {
359
359
  display: inline-flex;
360
360
  font-size: 30rpx;
361
361
  text-align: center;
362
- transition: all $pi-animation-duration $pi-animation-timing-function;
363
362
  &.active {
364
363
  color: $pi-primary-color;
365
364
  }
@@ -397,3 +396,10 @@ export default {
397
396
  }
398
397
  }
399
398
  </style>
399
+
400
+ <style lang="scss">
401
+ .pi-tabs scoped-slots-item {
402
+ width: 100%;
403
+ height: 100%;
404
+ }
405
+ </style>
@@ -19,5 +19,6 @@ export default {
19
19
  selectedImg: null, // 选中图标的配置
20
20
  selectedCheckbox: null, // 选中复选框配置
21
21
  stretch: false, // 标签是否均分布局,可选值 `true`
22
+ tabHeight: 80, // 标签的高度,单位rpx
22
23
  maskAlignTop: true // 是否需要蒙层顶部对齐组件,可选值 `false`
23
24
  }
package/config/select.js CHANGED
@@ -8,6 +8,7 @@ export default {
8
8
  items: [], // 选项列表,默认([])
9
9
  keyField: 'id', // 选项id字段,默认为id
10
10
  displayField: 'text', // 选项显示字段,默认为text
11
+ descField: 'desc', // 描述显示字段,默认为desc
11
12
  keyDefaultValue: false, // 是否只绑定keyField的默认值,默认false
12
13
  defaultValue: null, // 默认值,单选是传Object,多选时传Array,默认null
13
14
  isMulti: false, // 是否多选,(默认:false)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7beta28",
3
+ "version": "1.2.7beta30",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {