sadais-piui 1.2.5 → 1.2.6-beta3

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.
@@ -161,6 +161,10 @@ export default {
161
161
  </script>
162
162
 
163
163
  <style lang="scss" scoped>
164
+ .pi-calendar {
165
+ max-width: 960rpx;
166
+ margin: 0 auto;
167
+ }
164
168
  .date-item {
165
169
  position: relative;
166
170
  z-index: 2;
@@ -29,8 +29,10 @@ export default {
29
29
  'labelWidth',
30
30
  'labelAlign',
31
31
  'labelStyle',
32
+ 'itemVerticalAlign',
32
33
  'inputAlign',
33
34
  'wrap',
35
+ 'wrapBottomGap',
34
36
  'labelWrapBorder',
35
37
  'colon',
36
38
  'disabled',
@@ -129,6 +131,18 @@ export default {
129
131
  return form.labelStyle
130
132
  }
131
133
  },
134
+ // 表单项垂直对齐方式,可选值为 top center bottom
135
+ itemVerticalAlign: {
136
+ // `'top'` `'center'` `'bottom'`
137
+ type: String,
138
+ // 'center'
139
+ default() {
140
+ return form.itemVerticalAlign
141
+ },
142
+ validator: function(value) {
143
+ return [null, 'top', 'center', 'bottom'].includes(value)
144
+ }
145
+ },
132
146
  // 表单输入区域 label 对齐方式
133
147
  inputAlign: {
134
148
  // `'left'` `'center'` `'right'`
@@ -147,6 +161,12 @@ export default {
147
161
  // null
148
162
  default: form.wrap
149
163
  },
164
+ // wrap模式下是否在底部增加表单项之间的间距
165
+ wrapBottomGap: {
166
+ type: Boolean,
167
+ // null
168
+ default: form.wrapBottomGap
169
+ },
150
170
  // wrap样式label是否显示边框
151
171
  labelWrapBorder: {
152
172
  type: Boolean,
@@ -6,6 +6,7 @@
6
6
  { disabled: getDisabled },
7
7
  { border: getBorder },
8
8
  { 'pi-align-center': !getWrap },
9
+ getFormItemClass,
9
10
  customClass
10
11
  ]"
11
12
  @tap="handleItemClick"
@@ -13,7 +14,7 @@
13
14
  <!-- 表单标题 -->
14
15
  <view
15
16
  v-if="label || $slots.label"
16
- class="form-label pi-align-start pi-flex-nowrap"
17
+ class="form-label pi-pd-tb-8 pi-align-start pi-flex-nowrap"
17
18
  :style="[computedLabelStyle, getLabelStyle]"
18
19
  :class="[{ border: getWrap && getLabelWrapBorder }]"
19
20
  >
@@ -30,7 +31,11 @@
30
31
  <!-- 内容区域 -->
31
32
  <view
32
33
  class="content-wrap"
33
- :class="[{ 'pi-flex-sub': !getWrap }, getInputAlign, { wrap: getWrap, nowrap: !getWrap }]"
34
+ :class="[
35
+ { 'pi-flex-sub': !getWrap },
36
+ getInputAlign,
37
+ { 'wrap': getWrap, 'nowrap': !getWrap, 'wrap-bottom': getWrap && getWrapBottomGap }
38
+ ]"
34
39
  :style="[contentWrapStyle]"
35
40
  >
36
41
  <view
@@ -86,6 +91,12 @@ const alignFlexMap = {
86
91
  right: 'flex-end'
87
92
  }
88
93
 
94
+ const verticalAlignFlexMap = {
95
+ top: 'flex-start',
96
+ center: 'center',
97
+ bottom: 'flex-end'
98
+ }
99
+
89
100
  export default {
90
101
  name: 'PiFormItem',
91
102
  mixins: [extendPiFrom, Emitter], // 注入inheritProps
@@ -166,6 +177,18 @@ export default {
166
177
  return formItem.labelStyle
167
178
  }
168
179
  },
180
+ // 表单项垂直对齐方式,可选值为 top center bottom
181
+ itemVerticalAlign: {
182
+ // `'top'` `'center'` `'bottom'`
183
+ type: String,
184
+ // 'center'
185
+ default() {
186
+ return formItem.itemVerticalAlign
187
+ },
188
+ validator: function(value) {
189
+ return [null, 'top', 'center', 'bottom'].includes(value)
190
+ }
191
+ },
169
192
  // 表单label区域 label 对齐方式
170
193
  labelAlign: {
171
194
  // `'left'` `'center'` `'right'`
@@ -196,6 +219,12 @@ export default {
196
219
  // false
197
220
  default: formItem.wrap
198
221
  },
222
+ // wrap模式下是否在底部增加表单项之间的间距
223
+ wrapBottomGap: {
224
+ type: Boolean,
225
+ // null
226
+ default: formItem.wrapBottomGap
227
+ },
199
228
  // wrap样式label是否显示边框
200
229
  labelWrapBorder: {
201
230
  type: Boolean,
@@ -258,6 +287,9 @@ export default {
258
287
  getWrap() {
259
288
  return this.$pi.expand.getPropValue(this.inheritProps.wrap, this.wrap)
260
289
  },
290
+ getWrapBottomGap() {
291
+ return this.$pi.expand.getPropValue(this.inheritProps.wrapBottomGap, this.wrapBottomGap)
292
+ },
261
293
  getLabelWrapBorder() {
262
294
  return this.inheritProps.labelWrapBorder !== null
263
295
  ? this.inheritProps.labelWrapBorder
@@ -296,6 +328,12 @@ export default {
296
328
  getLabelStyle() {
297
329
  return this.$pi.expand.getPropValue(this.inheritProps.labelStyle, this.labelStyle)
298
330
  },
331
+ getItemVerticalAlign() {
332
+ return this.$pi.expand.getPropValue(
333
+ this.inheritProps.itemVerticalAlign,
334
+ this.itemVerticalAlign
335
+ )
336
+ },
299
337
  computedLabelStyle() {
300
338
  const style = {}
301
339
  if (this.getWrap) {
@@ -324,6 +362,19 @@ export default {
324
362
  return {
325
363
  justifyContent: alignFlexMap[this.getInputAlign]
326
364
  }
365
+ },
366
+ getFormItemClass() {
367
+ const classList = {}
368
+ if (this.getDisabled) {
369
+ classList.disabled = true
370
+ }
371
+ if (this.getBorder) {
372
+ classList.border = true
373
+ }
374
+ if (!this.getWrap && this.getItemVerticalAlign) {
375
+ classList[verticalAlignFlexMap[this.itemVerticalAlign]] = true
376
+ }
377
+ return classList
327
378
  }
328
379
  },
329
380
  mounted() {
@@ -462,7 +513,7 @@ export default {
462
513
  &.nowrap {
463
514
  margin-left: 24rpx;
464
515
  }
465
- &.wrap {
516
+ &.wrap-bottom {
466
517
  margin-bottom: 24rpx;
467
518
  }
468
519
  .form-valid {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="pi-input-wrap">
2
+ <view class="pi-input-wrap" :style="[getInputWrapStyle]">
3
3
  <textarea
4
4
  v-if="type === 'textarea'"
5
5
  class="pi-input-textarea"
@@ -145,6 +145,12 @@ export default {
145
145
  // false
146
146
  default: input.disabled
147
147
  },
148
+ // 边框样式设置
149
+ border: {
150
+ type: [Boolean, String],
151
+ // false
152
+ default: input.border
153
+ },
148
154
  // 最大输入长度,设置为 -1 的时候不限制最大长度
149
155
  maxlength: {
150
156
  type: [Number, String],
@@ -247,6 +253,19 @@ export default {
247
253
  const parentFormItem = this.$pi.parent(this, 'PiFormItem')
248
254
  const disabled = this.disabled || (parentFormItem && parentFormItem.getDisabled)
249
255
  return disabled
256
+ },
257
+ getInputWrapStyle() {
258
+ const style = {}
259
+ if (this.border) {
260
+ style.padding = '8rpx 14rpx'
261
+ style.borderRadius = '4rpx'
262
+ if (this.$pi.lang.isString(this.border)) {
263
+ style.border = this.border
264
+ } else {
265
+ style.border = '1Px solid #d9d9d9'
266
+ }
267
+ }
268
+ return style
250
269
  }
251
270
  },
252
271
  methods: {
@@ -281,6 +281,8 @@ export default {
281
281
  <style lang="scss" scoped>
282
282
  .pi-popup-select {
283
283
  height: 100%;
284
+ max-width: 960rpx;
285
+ margin: 0 auto;
284
286
  .pi-button-wrap {
285
287
  flex: 1;
286
288
  &:nth-child(2) {
@@ -3,7 +3,7 @@
3
3
  class="section pi-align-center"
4
4
  :style="[itemStyle, customStyle]"
5
5
  :class="[{ border }, customClass]"
6
- @tap.stop="handleSectionClick"
6
+ @tap="handleSectionClick"
7
7
  >
8
8
  <view v-if="line" class="line" :style="[lineStyle]" />
9
9
  <!-- 左侧区域 -->
@@ -0,0 +1,399 @@
1
+ <template>
2
+ <view
3
+ ref="pi-subsection"
4
+ class="pi-subsection"
5
+ :class="[`pi-subsection--${mode}`, { round: round }, customClass]"
6
+ :style="[customStyle, wrapperStyle]"
7
+ >
8
+ <view
9
+ ref="pi-subsection__bar"
10
+ class="pi-subsection__bar"
11
+ :style="[barStyle]"
12
+ :class="[barClass]"
13
+ />
14
+ <view
15
+ v-for="(item, index) in items"
16
+ :ref="`pi-subsection__item--${index}`"
17
+ :key="index"
18
+ class="pi-subsection__item"
19
+ :class="[itemClass(index)]"
20
+ :style="[itemStyle(index)]"
21
+ @tap="clickHandler(index)"
22
+ >
23
+ <text class="pi-subsection__item__text" :style="[textStyle(index)]">{{ getText(item) }}</text>
24
+ </view>
25
+ </view>
26
+ </template>
27
+
28
+ <script>
29
+ // #ifdef APP-NVUE
30
+ const dom = uni.requireNativePlugin('dom')
31
+ const animation = uni.requireNativePlugin('animation')
32
+ // #endif
33
+ import { getConfig } from '../../config'
34
+ const { subsection } = getConfig()
35
+ /**
36
+ * Subsection 分段器
37
+ * @description 该分段器一般用于用户从几个选项中选择某一个的场景
38
+ * @tutorial http://piui.sadais.com/docs/components/Subsection.html
39
+ * @event {Function} change 分段器选项发生改变时触发 回调 index:选项的index索引值,从0开始
40
+ * @example <pi-subsection :items="items" :current="curNow" @change="sectionChange" />
41
+ */
42
+ export default {
43
+ name: 'PiSubsection',
44
+ props: {
45
+ // 自定义样式,对象形式
46
+ customStyle: {
47
+ type: Object,
48
+ // `{}`
49
+ default() {
50
+ return subsection.customStyle
51
+ }
52
+ },
53
+ // 自定义样式类,字符串形式
54
+ customClass: {
55
+ type: String,
56
+ // ''
57
+ default() {
58
+ return subsection.customClass
59
+ }
60
+ },
61
+ // tab的数据
62
+ items: {
63
+ type: Array,
64
+ // []
65
+ default() {
66
+ return subsection.items
67
+ }
68
+ },
69
+ // 当前活动的tab的index
70
+ current: {
71
+ type: [String, Number],
72
+ // 0
73
+ default() {
74
+ return subsection.current
75
+ }
76
+ },
77
+ // 激活时的颜色
78
+ activeColor: {
79
+ type: String,
80
+ // #5a7dff
81
+ default() {
82
+ return subsection.activeColor
83
+ }
84
+ },
85
+ // 未激活时的颜色
86
+ inactiveColor: {
87
+ type: String,
88
+ // #303133
89
+ default() {
90
+ return subsection.inactiveColor
91
+ }
92
+ },
93
+ // 模式选择,mode=button为按钮形式,mode=subsection时为分段模式
94
+ mode: {
95
+ type: String,
96
+ // button
97
+ default() {
98
+ return subsection.mode
99
+ }
100
+ },
101
+ // 圆角模式
102
+ round: {
103
+ type: Boolean,
104
+ // false
105
+ default() {
106
+ return subsection.round
107
+ }
108
+ },
109
+ // 字体大小,单位px
110
+ fontSize: {
111
+ type: [String, Number],
112
+ // 24rpx
113
+ default() {
114
+ return subsection.fontSize
115
+ }
116
+ },
117
+ // 激活选项的字体是否加粗
118
+ bold: {
119
+ type: Boolean,
120
+ // true
121
+ default() {
122
+ return subsection.bold
123
+ }
124
+ },
125
+ // 组件背景颜色,mode为button时有效
126
+ bgColor: {
127
+ type: String,
128
+ // #eeeeef
129
+ default() {
130
+ return subsection.bgColor
131
+ }
132
+ },
133
+ // 从`items`元素对象中读取的键名
134
+ keyName: {
135
+ type: String,
136
+ // name
137
+ default() {
138
+ return subsection.keyName
139
+ }
140
+ }
141
+ },
142
+ data() {
143
+ return {
144
+ // 组件尺寸
145
+ itemRect: {
146
+ width: 0,
147
+ height: 0
148
+ }
149
+ }
150
+ },
151
+ computed: {
152
+ // 滑块指定class
153
+ barClass() {
154
+ // 默认按钮模式
155
+ let className = 'pi-subsection--button__bar'
156
+ // 分段器模式
157
+ if (this.mode === 'subsection') {
158
+ if (this.current === 0) {
159
+ className = 'pi-subsection__bar--first'
160
+ } else if (this.current > 0 && this.current < this.items.length - 1) {
161
+ className = 'pi-subsection__bar--center'
162
+ } else if (this.current === this.items.length - 1) {
163
+ className = 'pi-subsection__bar--last'
164
+ }
165
+ }
166
+ return className
167
+ },
168
+ wrapperStyle() {
169
+ const style = {}
170
+ // button模式时,设置背景色
171
+ if (this.mode === 'button') {
172
+ style.backgroundColor = this.bgColor
173
+ }
174
+ return style
175
+ },
176
+ // 滑块的样式
177
+ barStyle() {
178
+ const style = {}
179
+ style.width = `${this.itemRect.width}px`
180
+ style.height = `${this.itemRect.height}px`
181
+ // 通过translateX移动滑块,其移动的距离为索引*item的宽度
182
+ // #ifndef APP-NVUE
183
+ style.transform = `translateX(${this.current * this.itemRect.width}px)`
184
+ // #endif
185
+ if (this.mode === 'subsection') {
186
+ // 在subsection模式下,需要动态设置滑块的圆角,因为移动滑块使用的是translateX,无法通过父元素设置overflow: hidden隐藏滑块的直角
187
+ style.backgroundColor = this.activeColor
188
+ }
189
+ // 按钮圆角模式 按钮模式生效
190
+ if (this.round && this.mode === 'button') {
191
+ style.borderRadius = `${this.itemRect.height}px`
192
+ }
193
+ return style
194
+ },
195
+ // 分段器item的样式
196
+ itemStyle(index) {
197
+ return (index) => {
198
+ const style = {}
199
+ if (this.mode === 'subsection') {
200
+ // 设置border的样式
201
+ style.borderColor = this.activeColor
202
+ style.borderWidth = '2rpx'
203
+ style.borderStyle = 'solid'
204
+ if (this.round) {
205
+ if (index === 0) {
206
+ style.borderTopLeftRadius = `${this.itemRect.height}px`
207
+ style.borderBottomLeftRadius = `${this.itemRect.height}px`
208
+ } else if (index === this.items.length - 1) {
209
+ // 最后一个
210
+ style.borderTopRightRadius = `${this.itemRect.height}px`
211
+ style.borderBottomRightRadius = `${this.itemRect.height}px`
212
+ }
213
+ }
214
+ }
215
+ return style
216
+ }
217
+ },
218
+ // 分段器item的class
219
+ itemClass(index) {
220
+ return (index) => {
221
+ let className = `pi-subsection__item--${index}`
222
+ if (index === 0) {
223
+ className += ' pi-subsection__item--first'
224
+ } else if (index < this.items.length - 1) {
225
+ className += ' pi-subsection__item--no-border-right'
226
+ } else if (index === this.items.length - 1) {
227
+ className += ' pi-subsection__item--last'
228
+ }
229
+ return className
230
+ }
231
+ },
232
+ // 分段器文字颜色
233
+ textStyle(index) {
234
+ return (index) => {
235
+ const style = {}
236
+ style.fontWeight = this.bold && this.current === index ? 'bold' : 'normal'
237
+ style.fontSize = this.$pi.common.addUnit(this.fontSize)
238
+ // subsection模式下,激活时默认为白色的文字
239
+ if (this.mode === 'subsection') {
240
+ style.color = this.current === index ? '#fff' : this.inactiveColor
241
+ } else {
242
+ // button模式下,激活时文字颜色默认为activeColor
243
+ style.color = this.current === index ? this.activeColor : this.inactiveColor
244
+ }
245
+ return style
246
+ }
247
+ }
248
+ },
249
+ watch: {
250
+ items(newValue, oldValue) {
251
+ this.init()
252
+ },
253
+ current: {
254
+ immediate: true,
255
+ handler(n) {
256
+ // #ifdef APP-NVUE
257
+ // 在安卓nvue上,如果通过translateX进行位移,到最后一个时,会导致右侧无法绘制圆角
258
+ // 故用animation模块进行位移
259
+ const ref = this.$refs?.['pi-subsection__bar']?.ref
260
+ // 不存在ref的时候(理解为第一次初始化时,需要渲染dom,进行一定延时再获取ref),这里的100ms是经过测试得出的结果(某些安卓需要延时久一点),勿随意修改
261
+ this.sleep(ref ? 0 : 100).then(() => {
262
+ animation.transition(this.$refs['pi-subsection__bar'].ref, {
263
+ styles: {
264
+ transform: `translateX(${n * this.itemRect.width}px)`,
265
+ transformOrigin: 'center center'
266
+ },
267
+ duration: 300
268
+ })
269
+ })
270
+ // #endif
271
+ }
272
+ }
273
+ },
274
+ mounted() {
275
+ this.init()
276
+ },
277
+ methods: {
278
+ init() {
279
+ this.sleep().then(() => this.getRect())
280
+ },
281
+ // 判断展示文本
282
+ getText(item) {
283
+ return typeof item === 'object' ? item[this.keyName] : item
284
+ },
285
+ // 获取组件的尺寸
286
+ getRect() {
287
+ // #ifndef APP-NVUE
288
+ this.$pi.common.queryRect(this, '.pi-subsection__item--0', false).then((size) => {
289
+ this.itemRect = size
290
+ })
291
+ // #endif
292
+ // #ifdef APP-NVUE
293
+ const ref = this.$refs['pi-subsection__item--0'][0]
294
+ ref &&
295
+ dom.getComponentRect(ref, (res) => {
296
+ this.itemRect = res.size
297
+ })
298
+ // #endif
299
+ },
300
+ /**
301
+ * @description 进行延时,以达到可以简写代码的目的
302
+ * @param {number} value 堵塞时间 单位ms 毫秒
303
+ * @returns {Promise} 返回promise
304
+ */
305
+ sleep(value = 30) {
306
+ return new Promise((resolve) => {
307
+ setTimeout(() => {
308
+ resolve()
309
+ }, value)
310
+ })
311
+ },
312
+
313
+ clickHandler(index) {
314
+ this.$emit('change', index)
315
+ }
316
+ }
317
+ }
318
+ </script>
319
+ <style lang="scss" scoped>
320
+ .pi-subsection {
321
+ display: flex;
322
+ position: relative;
323
+ overflow: hidden;
324
+ /* #ifndef APP-NVUE */
325
+ width: 100%;
326
+ box-sizing: border-box;
327
+ /* #endif */
328
+ &.round {
329
+ border-radius: 60rpx;
330
+ }
331
+ &--button {
332
+ height: 64rpx;
333
+ background-color: rgb(238, 238, 239);
334
+ padding: 6rpx;
335
+ border-radius: 6rpx;
336
+ align-items: stretch;
337
+ &__bar {
338
+ background-color: #ffffff;
339
+ border-radius: 6rpx;
340
+ }
341
+ }
342
+ &--subsection {
343
+ height: 60rpx;
344
+ }
345
+ &__bar {
346
+ position: absolute;
347
+ /* #ifndef APP-NVUE */
348
+ transition-property: transform, color;
349
+ transition-duration: 0.3s;
350
+ transition-timing-function: ease-in-out;
351
+ /* #endif */
352
+ &--first {
353
+ border-top-left-radius: 6rpx;
354
+ border-bottom-left-radius: 6rpx;
355
+ border-top-right-radius: 0px;
356
+ border-bottom-right-radius: 0px;
357
+ }
358
+ &--center {
359
+ border-top-left-radius: 0px;
360
+ border-bottom-left-radius: 0px;
361
+ border-top-right-radius: 0px;
362
+ border-bottom-right-radius: 0px;
363
+ }
364
+ &--last {
365
+ border-top-left-radius: 0px;
366
+ border-bottom-left-radius: 0px;
367
+ border-top-right-radius: 6rpx;
368
+ border-bottom-right-radius: 6rpx;
369
+ }
370
+ }
371
+ &__item {
372
+ display: flex;
373
+ flex: 1;
374
+ justify-content: center;
375
+ align-items: center;
376
+ // vue环境下,需要设置相对定位,因为滑块为绝对定位,item需要在滑块的上面
377
+ position: relative;
378
+ &--no-border-right {
379
+ border-right-width: 0 !important;
380
+ }
381
+ &--first {
382
+ border-top-left-radius: 6rpx;
383
+ border-bottom-left-radius: 6rpx;
384
+ }
385
+ &--last {
386
+ border-top-right-radius: 6rpx;
387
+ border-bottom-right-radius: 6rpx;
388
+ }
389
+ &__text {
390
+ font-size: 24rpx;
391
+ line-height: 24rpx;
392
+ display: flex;
393
+ align-items: center;
394
+ transition-property: color;
395
+ transition-duration: 0.3s;
396
+ }
397
+ }
398
+ }
399
+ </style>
package/config/form.js CHANGED
@@ -9,10 +9,12 @@ export default {
9
9
  height: 100, // 表单项高度
10
10
  padding: '32rpx', // padding
11
11
  labelWidth: 120, // 表单项 label 宽度,默认单位为rpx
12
+ itemVerticalAlign: 'center', // 表单项垂直对齐方式,可选值为 top center bottom
12
13
  labelAlign: 'left', // 表单项 label 对齐方式,可选值为 left center right
13
14
  labelStyle: {}, // 表单项 label样式
14
15
  inputAlign: 'right', // 表单输入区域 label 对齐方式,可选值为 left center right
15
16
  wrap: false, // 是否以换行样式显示表单
17
+ wrapBottomGap: false, // wrap模式下是否在底部增加表单项之间的间距
16
18
  labelWrapBorder: false, // wrap样式label是否显示边框
17
19
  colon: false, // 是否在 label 后面添加冒号
18
20
  disabled: false, // 是否禁用
@@ -8,10 +8,12 @@ export default {
8
8
  height: null, // 高度
9
9
  padding: null, // padding
10
10
  labelWidth: null, // 表单项 label 宽度,默认单位为rpx
11
+ itemVerticalAlign: null, // 表单项垂直对齐方式,可选值为 top center bottom
11
12
  labelAlign: null, // 表单项 label 对齐方式,可选值为 left center right
12
13
  labelStyle: null, // 表单项 label样式
13
14
  inputAlign: null, // 表单输入区域 label 对齐方式,可选值为 left center right
14
15
  wrap: null, // 是否以换行样式显示表单
16
+ wrapBottomGap: null, // wrap模式下是否在底部增加表单项之间的间距
15
17
  labelWrapBorder: null, // wrap样式label是否显示边框
16
18
  colon: null, // 是否在 label 后面添加冒号
17
19
  disabled: null, // 是否禁用
package/config/input.js CHANGED
@@ -6,6 +6,7 @@ export default {
6
6
  placeholderStyle: 'color: #c0c4cc; font-weight: 400;', // 指定 placeholder 的样式
7
7
  placeholderClass: 'input-placeholder', // 指定 placeholder 的样式类,注意页面或组件的style中写了scoped时,需要在类名前写::v-deep
8
8
  disabled: false, // 是否禁用
9
+ border: false, // 边框样式设置
9
10
  maxlength: 140, // 最大输入长度,设置为 -1 的时候不限制最大长度
10
11
  password: false,
11
12
  cursorSpacing: 0, // 指定光标与键盘的距离,单位 px
@@ -0,0 +1,14 @@
1
+ export default {
2
+ items: [], // tab的数据
3
+ current: 0, // 当前活动的tab的index(默认 0 )
4
+ activeColor: '#5a7dff', // 激活时的颜色(默认 '#5a7dff' )
5
+ inactiveColor: '#303133', // 未激活时的颜色(默认 '#303133' )
6
+ mode: 'button', // 模式选择,mode=button为按钮形式,mode=subsection时为分段模式(默认 'button' )
7
+ round: false, // 圆角模式 默认 false
8
+ fontSize: 24, // 字体大小,单位px(默认 24rpx )
9
+ bold: true, // 激活选项的字体是否加粗(默认 true )
10
+ bgColor: '', // 组件背景颜色,mode为button时有效(默认 '#eeeeef' )
11
+ keyName: 'name', // 从`list`元素对象中读取的键名(默认 'name' )
12
+ customClass: '', // 自定义样式类,字符串形式('')
13
+ customStyle: {} // 自定义样式,对象形式(默认值:{})
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.5",
3
+ "version": "1.2.6beta3",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {