fusions-ui 1.2.3 → 1.2.4
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.
- package/components/fu-button/fu-button.vue +1 -0
- package/components/fu-form-item/fu-form-item.vue +20 -23
- package/components/fu-form-item/props.js +5 -0
- package/components/fu-popup/fu-popup.vue +1 -1
- package/components/fu-swiper/fu-swiper.vue +3 -3
- package/components/fu-swiper/props.js +1 -1
- package/package.json +1 -1
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
* @property {String} lang = [zh_CN|zh_TW|en] 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文(默认 en )
|
|
125
125
|
* @property {String} customClass 自定义外部class样式
|
|
126
126
|
* @property {Object,String} customStyle 自定义外部样式
|
|
127
|
+
* @property {Object,String} customTextStyle 自定义按钮文本样式
|
|
127
128
|
* @event {Function} click 非禁止并且非加载中,才能点击
|
|
128
129
|
* @event {Function} tap 非禁止并且非加载中,才能点击
|
|
129
130
|
* @event {Function} getphonenumber open-type="getPhoneNumber"时有效
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="fu-
|
|
3
|
-
:class="['is-direction-' + localLabelPos , border?'fu-
|
|
2
|
+
<view class="fu-form-item"
|
|
3
|
+
:class="['is-direction-' + localLabelPos , border?'fu-form-item--border': '' , border && isFirstBorder? 'is-first-border': '']">
|
|
4
4
|
<slot name="label">
|
|
5
|
-
<view class="fu-
|
|
5
|
+
<view class="fu-form-item__label" :class="{'no-label': !label && !required}" :style="{width: localLabelWidth, justifyContent: localLabelAlign}">
|
|
6
6
|
<text v-if="required" class="is-required">*</text>
|
|
7
7
|
<text>{{ label }}</text>
|
|
8
8
|
</view>
|
|
9
9
|
</slot>
|
|
10
10
|
<!-- #ifndef APP-NVUE -->
|
|
11
|
-
<view class="fu-
|
|
11
|
+
<view class="fu-form-item__content">
|
|
12
12
|
<slot></slot>
|
|
13
|
-
<view class="fu-
|
|
13
|
+
<view class="fu-form-item__error" :class="{'msg--active': msg}">
|
|
14
14
|
<text>{{ msg }}</text>
|
|
15
15
|
</view>
|
|
16
16
|
</view>
|
|
17
17
|
<!-- #endif -->
|
|
18
18
|
<!-- #ifdef APP-NVUE -->
|
|
19
|
-
<view class="fu-
|
|
20
|
-
<view class="fu-
|
|
19
|
+
<view class="fu-form-item__nuve-content">
|
|
20
|
+
<view class="fu-form-item__content">
|
|
21
21
|
<slot></slot>
|
|
22
22
|
</view>
|
|
23
|
-
<view class="fu-
|
|
23
|
+
<view class="fu-form-item__error" :class="{'msg--active': msg}">
|
|
24
24
|
<text class="error-text">{{ msg }}</text>
|
|
25
25
|
</view>
|
|
26
26
|
</view>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* @value right label 右侧对齐
|
|
44
44
|
* @property {String } message 显示的错误提示内容,如果为空字符串或者false,则不显示错误信息
|
|
45
45
|
* @property {String } prop 表单域的属性名,在使用校验规则时必填
|
|
46
|
-
* @property {String }
|
|
46
|
+
* @property {String } labelPosition = [top|left] label的文字的位置,优先级高于fu-form组件中的labelPosition
|
|
47
47
|
* @value top 顶部显示 label
|
|
48
48
|
* @value left 左侧显示 label
|
|
49
49
|
*/
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
// 宽度
|
|
223
223
|
this.localLabelWidth = this._labelWidthUnit(labelWidth);
|
|
224
224
|
// 标签位置
|
|
225
|
-
this.localLabelPos = this._labelPosition();
|
|
225
|
+
this.localLabelPos = this.labelPosition || this._labelPosition();
|
|
226
226
|
// 将需要校验的子组件加入form 队列
|
|
227
227
|
this.form && type && childrens.push(this)
|
|
228
228
|
|
|
@@ -367,17 +367,18 @@
|
|
|
367
367
|
},
|
|
368
368
|
'form.labelPosition'(val) {
|
|
369
369
|
// 标签位置
|
|
370
|
-
this.localLabelPos = this._labelPosition()
|
|
370
|
+
this.localLabelPos = this.labelPosition || this._labelPosition()
|
|
371
371
|
},
|
|
372
372
|
'form.labelAlign'(val) {
|
|
373
|
-
|
|
373
|
+
// 标签对齐方式
|
|
374
|
+
this.localLabelAlign = this._justifyContent();
|
|
374
375
|
}
|
|
375
376
|
}
|
|
376
377
|
}
|
|
377
378
|
</script>
|
|
378
379
|
|
|
379
380
|
<style lang="scss" scoped>
|
|
380
|
-
.fu-
|
|
381
|
+
.fu-form-item {
|
|
381
382
|
position: relative;
|
|
382
383
|
display: flex;
|
|
383
384
|
/* #ifdef APP-NVUE */
|
|
@@ -434,7 +435,7 @@
|
|
|
434
435
|
/* #endif */
|
|
435
436
|
}
|
|
436
437
|
|
|
437
|
-
& .fu-
|
|
438
|
+
& .fu-form-item__nuve-content {
|
|
438
439
|
display: flex;
|
|
439
440
|
flex-direction: column;
|
|
440
441
|
flex: 1;
|
|
@@ -478,7 +479,7 @@
|
|
|
478
479
|
&.is-direction-top {
|
|
479
480
|
flex-direction: column;
|
|
480
481
|
|
|
481
|
-
.fu-
|
|
482
|
+
.fu-form-item__label {
|
|
482
483
|
padding: 0 0 8px;
|
|
483
484
|
line-height: 1.5715;
|
|
484
485
|
text-align: left;
|
|
@@ -489,40 +490,37 @@
|
|
|
489
490
|
}
|
|
490
491
|
|
|
491
492
|
.is-required {
|
|
492
|
-
// color: $fu-color-error;
|
|
493
493
|
color: #dd524d;
|
|
494
494
|
font-weight: bold;
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
|
|
498
498
|
|
|
499
|
-
.fu-
|
|
499
|
+
.fu-form-item--border {
|
|
500
500
|
margin-bottom: 0;
|
|
501
501
|
padding: 10px 0;
|
|
502
|
-
// padding-bottom: 0;
|
|
503
502
|
border-top: 1px #eee solid;
|
|
504
503
|
|
|
505
504
|
/* #ifndef APP-NVUE */
|
|
506
|
-
.fu-
|
|
505
|
+
.fu-form-item__content {
|
|
507
506
|
flex-direction: column;
|
|
508
507
|
justify-content: flex-start;
|
|
509
508
|
align-items: flex-start;
|
|
510
509
|
|
|
511
|
-
.fu-
|
|
510
|
+
.fu-form-item__error {
|
|
512
511
|
position: relative;
|
|
513
512
|
top: 5px;
|
|
514
513
|
left: 0;
|
|
515
514
|
padding-top: 0;
|
|
516
515
|
}
|
|
517
516
|
}
|
|
518
|
-
|
|
519
517
|
/* #endif */
|
|
520
518
|
|
|
521
519
|
/* #ifdef APP-NVUE */
|
|
522
520
|
display: flex;
|
|
523
521
|
flex-direction: column;
|
|
524
522
|
|
|
525
|
-
.fu-
|
|
523
|
+
.fu-form-item__error {
|
|
526
524
|
position: relative;
|
|
527
525
|
top: 0px;
|
|
528
526
|
left: 0;
|
|
@@ -531,7 +529,6 @@
|
|
|
531
529
|
}
|
|
532
530
|
|
|
533
531
|
/* #endif */
|
|
534
|
-
|
|
535
532
|
}
|
|
536
533
|
|
|
537
534
|
.is-first-border {
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
* @property {Number} current 初始化时,默认显示第几项
|
|
103
103
|
* @property {String,Number} height 高度 (默认 125)
|
|
104
104
|
* @property {String} bgColor 背景色 (默认 #f2f3f4)
|
|
105
|
-
* @property {String}
|
|
105
|
+
* @property {String} nameKey 图片的属性名 (默认 image)
|
|
106
106
|
* @property {Boolean} showTitle = [true|false] 是否显示标题(默认 false)
|
|
107
107
|
* @property {String} keyTitle 标题的属性名
|
|
108
108
|
* @property {Object} titleStyle 自定义标题样式
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
methods: {
|
|
181
181
|
getItemType(e) {
|
|
182
182
|
if (typeof e === 'string') return this.$fu.isVideo(this.getSource(e)) ? 'video' : 'image'
|
|
183
|
-
if (typeof e === 'object' && this.
|
|
183
|
+
if (typeof e === 'object' && this.nameKey) {
|
|
184
184
|
if (!e.type) return this.$fu.isVideo(this.getSource(e)) ? 'video' : 'image'
|
|
185
185
|
if (e.type === 'image') return 'image'
|
|
186
186
|
if (e.type === 'video') return 'video'
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
|
|
191
191
|
getSource(e) {
|
|
192
192
|
if (typeof e === 'string') return e
|
|
193
|
-
if (typeof e === 'object' && this.
|
|
193
|
+
if (typeof e === 'object' && this.nameKey) return e[this.nameKey]
|
|
194
194
|
else this.$fu.error('请按格式传递列表参数')
|
|
195
195
|
return ''
|
|
196
196
|
},
|