uview-plus 3.0.17 → 3.1.3
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/changelog.md +8 -0
- package/components/u--form/u--form.vue +4 -2
- package/components/u--image/u--image.vue +4 -2
- package/components/u--input/u--input.vue +5 -3
- package/components/u--text/u--text.vue +4 -2
- package/components/u--textarea/u--textarea.vue +4 -2
- package/components/u-action-sheet/props.js +11 -10
- package/components/u-action-sheet/u-action-sheet.vue +3 -1
- package/components/u-album/props.js +12 -11
- package/components/u-album/u-album.vue +4 -2
- package/components/u-alert/props.js +9 -8
- package/components/u-alert/u-alert.vue +3 -1
- package/components/u-avatar/props.js +15 -14
- package/components/u-avatar/u-avatar.vue +3 -1
- package/components/u-avatar-group/props.js +10 -9
- package/components/u-avatar-group/u-avatar-group.vue +3 -1
- package/components/u-back-top/props.js +11 -10
- package/components/u-back-top/u-back-top.vue +2 -0
- package/components/u-badge/props.js +15 -14
- package/components/u-badge/u-badge.vue +3 -1
- package/components/u-button/props.js +29 -28
- package/components/u-button/u-button.vue +4 -2
- package/components/u-calendar/month.vue +5 -2
- package/components/u-calendar/props.js +28 -27
- package/components/u-calendar/u-calendar.vue +3 -1
- package/components/u-calendar/util.js +1 -0
- package/components/u-car-keyboard/props.js +1 -0
- package/components/u-car-keyboard/u-car-keyboard.vue +4 -2
- package/components/u-cell/props.js +18 -17
- package/components/u-cell/u-cell.vue +3 -1
- package/components/u-cell-group/props.js +3 -2
- package/components/u-cell-group/u-cell-group.vue +3 -1
- package/components/u-checkbox/props.js +14 -13
- package/components/u-checkbox/u-checkbox.vue +3 -1
- package/components/u-checkbox-group/props.js +16 -15
- package/components/u-checkbox-group/u-checkbox-group.vue +3 -1
- package/components/u-circle-progress/props.js +2 -1
- package/components/u-circle-progress/u-circle-progress.vue +3 -1
- package/components/u-code/props.js +7 -6
- package/components/u-code/u-code.vue +3 -1
- package/components/u-code-input/props.js +16 -15
- package/components/u-code-input/u-code-input.vue +3 -1
- package/components/u-col/props.js +6 -5
- package/components/u-col/u-col.vue +3 -1
- package/components/u-collapse/props.js +4 -3
- package/components/u-collapse/u-collapse.vue +3 -1
- package/components/u-collapse-item/props.js +12 -11
- package/components/u-collapse-item/u-collapse-item.vue +20 -18
- package/components/u-column-notice/props.js +11 -10
- package/components/u-column-notice/u-column-notice.vue +3 -1
- package/components/u-count-down/props.js +5 -4
- package/components/u-count-down/u-count-down.vue +5 -3
- package/components/u-count-to/props.js +12 -11
- package/components/u-count-to/u-count-to.vue +3 -1
- package/components/u-datetime-picker/props.js +24 -23
- package/components/u-datetime-picker/u-datetime-picker.vue +3 -1
- package/components/u-divider/props.js +9 -8
- package/components/u-divider/u-divider.vue +3 -1
- package/components/u-dropdown/props.js +5 -4
- package/components/u-dropdown/u-dropdown.vue +4 -2
- package/components/u-dropdown-item/props.js +2 -1
- package/components/u-dropdown-item/u-dropdown-item.vue +4 -2
- package/components/u-empty/props.js +12 -11
- package/components/u-empty/u-empty.vue +3 -2
- package/components/u-form/props.js +9 -8
- package/components/u-form/u-form.vue +13 -11
- package/components/u-form-item/props.js +9 -8
- package/components/u-form-item/u-form-item.vue +3 -1
- package/components/u-gap/props.js +5 -4
- package/components/u-gap/u-gap.vue +3 -1
- package/components/u-grid/props.js +4 -3
- package/components/u-grid/u-grid.vue +3 -1
- package/components/u-grid-item/props.js +3 -2
- package/components/u-grid-item/u-grid-item.vue +3 -1
- package/components/u-icon/props.js +18 -17
- package/components/u-icon/u-icon.vue +4 -2
- package/components/u-image/props.js +18 -17
- package/components/u-image/u-image.vue +3 -1
- package/components/u-index-anchor/props.js +6 -5
- package/components/u-index-anchor/u-index-anchor.vue +3 -1
- package/components/u-index-item/props.js +1 -0
- package/components/u-index-item/u-index-item.vue +3 -1
- package/components/u-index-list/props.js +6 -5
- package/components/u-index-list/u-index-list.vue +3 -1
- package/components/u-input/props.js +36 -35
- package/components/u-input/u-input.vue +3 -1
- package/components/u-keyboard/props.js +17 -16
- package/components/u-keyboard/u-keyboard.vue +3 -1
- package/components/u-line/props.js +7 -6
- package/components/u-line/u-line.vue +3 -1
- package/components/u-line-progress/props.js +6 -5
- package/components/u-line-progress/u-line-progress.vue +3 -1
- package/components/u-link/props.js +8 -7
- package/components/u-link/u-link.vue +3 -1
- package/components/u-list/props.js +15 -14
- package/components/u-list/u-list.vue +3 -1
- package/components/u-list-item/props.js +2 -1
- package/components/u-list-item/u-list-item.vue +3 -1
- package/components/u-loading-icon/props.js +13 -12
- package/components/u-loading-icon/u-loading-icon.vue +4 -2
- package/components/u-loading-page/props.js +10 -9
- package/components/u-loading-page/u-loading-page.vue +3 -1
- package/components/u-loadmore/props.js +19 -18
- package/components/u-loadmore/u-loadmore.vue +3 -1
- package/components/u-modal/props.js +17 -16
- package/components/u-modal/u-modal.vue +4 -2
- package/components/u-navbar/props.js +34 -33
- package/components/u-navbar/u-navbar.vue +3 -1
- package/components/u-no-network/props.js +4 -3
- package/components/u-no-network/u-no-network.vue +3 -1
- package/components/u-notice-bar/props.js +14 -13
- package/components/u-notice-bar/u-notice-bar.vue +3 -1
- package/components/u-notify/props.js +10 -9
- package/components/u-notify/u-notify.vue +3 -1
- package/components/u-number-box/props.js +23 -22
- package/components/u-number-box/u-number-box.vue +3 -1
- package/components/u-number-keyboard/props.js +4 -3
- package/components/u-number-keyboard/u-number-keyboard.vue +3 -1
- package/components/u-overlay/props.js +5 -4
- package/components/u-overlay/u-overlay.vue +3 -1
- package/components/u-parse/props.js +9 -8
- package/components/u-picker/props.js +16 -15
- package/components/u-picker/u-picker.vue +3 -1
- package/components/u-picker-column/props.js +1 -0
- package/components/u-picker-column/u-picker-column.vue +3 -1
- package/components/u-popup/props.js +16 -15
- package/components/u-popup/u-popup.vue +4 -2
- package/components/u-radio/props.js +13 -12
- package/components/u-radio/u-radio.vue +3 -1
- package/components/u-radio-group/props.js +18 -17
- package/components/u-radio-group/u-radio-group.vue +3 -1
- package/components/u-rate/props.js +15 -14
- package/components/u-rate/u-rate.vue +3 -1
- package/components/u-read-more/props.js +9 -8
- package/components/u-read-more/u-read-more.vue +3 -1
- package/components/u-row/props.js +4 -3
- package/components/u-row/u-row.vue +3 -1
- package/components/u-row-notice/props.js +8 -7
- package/components/u-row-notice/u-row-notice.vue +3 -1
- package/components/u-safe-bottom/props.js +1 -0
- package/components/u-safe-bottom/u-safe-bottom.vue +4 -2
- package/components/u-scroll-list/props.js +7 -6
- package/components/u-scroll-list/u-scroll-list.vue +3 -1
- package/components/u-search/props.js +25 -24
- package/components/u-search/u-search.vue +3 -1
- package/components/u-skeleton/props.js +12 -11
- package/components/u-skeleton/u-skeleton.vue +3 -1
- package/components/u-slider/props.js +11 -10
- package/components/u-slider/u-slider.vue +5 -3
- package/components/u-status-bar/props.js +2 -1
- package/components/u-status-bar/u-status-bar.vue +3 -1
- package/components/u-steps/props.js +9 -8
- package/components/u-steps/u-steps.vue +3 -1
- package/components/u-steps-item/props.js +5 -4
- package/components/u-steps-item/u-steps-item.vue +3 -1
- package/components/u-sticky/props.js +7 -6
- package/components/u-sticky/u-sticky.vue +4 -2
- package/components/u-subsection/props.js +10 -9
- package/components/u-subsection/u-subsection.vue +3 -1
- package/components/u-swipe-action/props.js +2 -1
- package/components/u-swipe-action/u-swipe-action.vue +3 -1
- package/components/u-swipe-action-item/props.js +7 -6
- package/components/u-swipe-action-item/u-swipe-action-item.vue +5 -3
- package/components/u-swiper/props.js +25 -24
- package/components/u-swiper/u-swiper.vue +3 -1
- package/components/u-swiper-indicator/props.js +6 -5
- package/components/u-swiper-indicator/u-swiper-indicator.vue +3 -1
- package/components/u-switch/props.js +12 -11
- package/components/u-switch/u-switch.vue +3 -1
- package/components/u-tabbar/props.js +9 -8
- package/components/u-tabbar/u-tabbar.vue +3 -1
- package/components/u-tabbar-item/props.js +7 -6
- package/components/u-tabbar-item/u-tabbar-item.vue +3 -1
- package/components/u-table/props.js +1 -0
- package/components/u-table/u-table.vue +3 -1
- package/components/u-tabs/props.js +13 -12
- package/components/u-tabs/u-tabs.vue +3 -1
- package/components/u-tabs-item/props.js +1 -0
- package/components/u-tabs-item/u-tabs-item.vue +3 -1
- package/components/u-tag/props.js +16 -15
- package/components/u-tag/u-tag.vue +5 -3
- package/components/u-td/props.js +1 -0
- package/components/u-td/u-td.vue +3 -1
- package/components/u-text/props.js +22 -21
- package/components/u-text/u-text.vue +4 -2
- package/components/u-textarea/props.js +24 -23
- package/components/u-textarea/u-textarea.vue +3 -1
- package/components/u-toast/u-toast.vue +3 -1
- package/components/u-toolbar/props.js +7 -6
- package/components/u-toolbar/u-toolbar.vue +3 -1
- package/components/u-tooltip/props.js +12 -11
- package/components/u-tooltip/u-tooltip.vue +3 -1
- package/components/u-tr/props.js +1 -0
- package/components/u-tr/u-tr.vue +3 -1
- package/components/u-transition/{nvue.ani-map.js → nvue-ani-map.js} +0 -0
- package/components/u-transition/props.js +5 -4
- package/components/u-transition/transition.js +3 -1
- package/components/u-transition/u-transition.vue +3 -1
- package/components/u-upload/props.js +23 -22
- package/components/u-upload/u-upload.vue +4 -2
- package/index.js +1 -0
- package/libs/config/config.js +2 -2
- package/package.json +1 -1
|
@@ -1,84 +1,85 @@
|
|
|
1
|
+
import defprops from '../../libs/config/props';
|
|
1
2
|
export default {
|
|
2
3
|
props: {
|
|
3
4
|
// 图片地址
|
|
4
5
|
src: {
|
|
5
6
|
type: String,
|
|
6
|
-
default:
|
|
7
|
+
default: defprops.image.src
|
|
7
8
|
},
|
|
8
9
|
// 裁剪模式
|
|
9
10
|
mode: {
|
|
10
11
|
type: String,
|
|
11
|
-
default:
|
|
12
|
+
default: defprops.image.mode
|
|
12
13
|
},
|
|
13
14
|
// 宽度,单位任意
|
|
14
15
|
width: {
|
|
15
16
|
type: [String, Number],
|
|
16
|
-
default:
|
|
17
|
+
default: defprops.image.width
|
|
17
18
|
},
|
|
18
19
|
// 高度,单位任意
|
|
19
20
|
height: {
|
|
20
21
|
type: [String, Number],
|
|
21
|
-
default:
|
|
22
|
+
default: defprops.image.height
|
|
22
23
|
},
|
|
23
24
|
// 图片形状,circle-圆形,square-方形
|
|
24
25
|
shape: {
|
|
25
26
|
type: String,
|
|
26
|
-
default:
|
|
27
|
+
default: defprops.image.shape
|
|
27
28
|
},
|
|
28
29
|
// 圆角,单位任意
|
|
29
30
|
radius: {
|
|
30
31
|
type: [String, Number],
|
|
31
|
-
default:
|
|
32
|
+
default: defprops.image.radius
|
|
32
33
|
},
|
|
33
34
|
// 是否懒加载,微信小程序、App、百度小程序、字节跳动小程序
|
|
34
35
|
lazyLoad: {
|
|
35
36
|
type: Boolean,
|
|
36
|
-
default:
|
|
37
|
+
default: defprops.image.lazyLoad
|
|
37
38
|
},
|
|
38
39
|
// 开启长按图片显示识别微信小程序码菜单
|
|
39
40
|
showMenuByLongpress: {
|
|
40
41
|
type: Boolean,
|
|
41
|
-
default:
|
|
42
|
+
default: defprops.image.showMenuByLongpress
|
|
42
43
|
},
|
|
43
44
|
// 加载中的图标,或者小图片
|
|
44
45
|
loadingIcon: {
|
|
45
46
|
type: String,
|
|
46
|
-
default:
|
|
47
|
+
default: defprops.image.loadingIcon
|
|
47
48
|
},
|
|
48
49
|
// 加载失败的图标,或者小图片
|
|
49
50
|
errorIcon: {
|
|
50
51
|
type: String,
|
|
51
|
-
default:
|
|
52
|
+
default: defprops.image.errorIcon
|
|
52
53
|
},
|
|
53
54
|
// 是否显示加载中的图标或者自定义的slot
|
|
54
55
|
showLoading: {
|
|
55
56
|
type: Boolean,
|
|
56
|
-
default:
|
|
57
|
+
default: defprops.image.showLoading
|
|
57
58
|
},
|
|
58
59
|
// 是否显示加载错误的图标或者自定义的slot
|
|
59
60
|
showError: {
|
|
60
61
|
type: Boolean,
|
|
61
|
-
default:
|
|
62
|
+
default: defprops.image.showError
|
|
62
63
|
},
|
|
63
64
|
// 是否需要淡入效果
|
|
64
65
|
fade: {
|
|
65
66
|
type: Boolean,
|
|
66
|
-
default:
|
|
67
|
+
default: defprops.image.fade
|
|
67
68
|
},
|
|
68
69
|
// 只支持网络资源,只对微信小程序有效
|
|
69
70
|
webp: {
|
|
70
71
|
type: Boolean,
|
|
71
|
-
default:
|
|
72
|
+
default: defprops.image.webp
|
|
72
73
|
},
|
|
73
74
|
// 过渡时间,单位ms
|
|
74
75
|
duration: {
|
|
75
76
|
type: [String, Number],
|
|
76
|
-
default:
|
|
77
|
+
default: defprops.image.duration
|
|
77
78
|
},
|
|
78
79
|
// 背景颜色,用于深色页面加载图片时,为了和背景色融合
|
|
79
80
|
bgColor: {
|
|
80
81
|
type: String,
|
|
81
|
-
default:
|
|
82
|
+
default: defprops.image.bgColor
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
}
|
|
85
|
+
}
|
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
|
|
66
66
|
<script>
|
|
67
67
|
import props from './props.js';
|
|
68
|
+
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
69
|
+
import mixin from '../../libs/mixin/mixin.js';
|
|
68
70
|
/**
|
|
69
71
|
* Image 图片
|
|
70
72
|
* @description 此组件为uni-app的image组件的加强版,在继承了原有功能外,还支持淡入动画、加载中、加载失败提示、圆角值和形状等。
|
|
@@ -93,7 +95,7 @@
|
|
|
93
95
|
*/
|
|
94
96
|
export default {
|
|
95
97
|
name: 'u-image',
|
|
96
|
-
mixins: [
|
|
98
|
+
mixins: [mpMixin, mixin, props],
|
|
97
99
|
data() {
|
|
98
100
|
return {
|
|
99
101
|
// 图片是否加载错误,如果是,则显示错误占位图
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
+
import defprops from '../../libs/config/props';
|
|
1
2
|
export default {
|
|
2
3
|
props: {
|
|
3
4
|
// 列表锚点文本内容
|
|
4
5
|
text: {
|
|
5
6
|
type: [String, Number],
|
|
6
|
-
default:
|
|
7
|
+
default: defprops.indexAnchor.text
|
|
7
8
|
},
|
|
8
9
|
// 列表锚点文字颜色
|
|
9
10
|
color: {
|
|
10
11
|
type: String,
|
|
11
|
-
default:
|
|
12
|
+
default: defprops.indexAnchor.color
|
|
12
13
|
},
|
|
13
14
|
// 列表锚点文字大小,单位默认px
|
|
14
15
|
size: {
|
|
15
16
|
type: [String, Number],
|
|
16
|
-
default:
|
|
17
|
+
default: defprops.indexAnchor.size
|
|
17
18
|
},
|
|
18
19
|
// 列表锚点背景颜色
|
|
19
20
|
bgColor: {
|
|
20
21
|
type: String,
|
|
21
|
-
default:
|
|
22
|
+
default: defprops.indexAnchor.bgColor
|
|
22
23
|
},
|
|
23
24
|
// 列表锚点高度,单位默认px
|
|
24
25
|
height: {
|
|
25
26
|
type: [String, Number],
|
|
26
|
-
default:
|
|
27
|
+
default: defprops.indexAnchor.height
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
27
|
import props from './props.js';
|
|
28
|
+
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
29
|
+
import mixin from '../../libs/mixin/mixin.js';
|
|
28
30
|
// #ifdef APP-NVUE
|
|
29
31
|
const dom = uni.requireNativePlugin('dom')
|
|
30
32
|
// #endif
|
|
@@ -41,7 +43,7 @@
|
|
|
41
43
|
*/
|
|
42
44
|
export default {
|
|
43
45
|
name: 'u-index-anchor',
|
|
44
|
-
mixins: [
|
|
46
|
+
mixins: [mpMixin, mixin, props],
|
|
45
47
|
data() {
|
|
46
48
|
return {
|
|
47
49
|
}
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
18
|
import props from './props.js';
|
|
19
|
+
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
20
|
+
import mixin from '../../libs/mixin/mixin.js';
|
|
19
21
|
// #ifdef APP-NVUE
|
|
20
22
|
// 由于weex为阿里的KPI业绩考核的产物,所以不支持百分比单位,这里需要通过dom查询组件的宽度
|
|
21
23
|
const dom = uni.requireNativePlugin('dom')
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
*/
|
|
31
33
|
export default {
|
|
32
34
|
name: 'u-index-item',
|
|
33
|
-
mixins: [
|
|
35
|
+
mixins: [mpMixin, mixin, props],
|
|
34
36
|
data() {
|
|
35
37
|
return {
|
|
36
38
|
// 本组件到滚动条顶部的距离
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
+
import defprops from '../../libs/config/props';
|
|
1
2
|
export default {
|
|
2
3
|
props: {
|
|
3
4
|
// 右边锚点非激活的颜色
|
|
4
5
|
inactiveColor: {
|
|
5
6
|
type: String,
|
|
6
|
-
default:
|
|
7
|
+
default: defprops.indexList.inactiveColor
|
|
7
8
|
},
|
|
8
9
|
// 右边锚点激活的颜色
|
|
9
10
|
activeColor: {
|
|
10
11
|
type: String,
|
|
11
|
-
default:
|
|
12
|
+
default: defprops.indexList.activeColor
|
|
12
13
|
},
|
|
13
14
|
// 索引字符列表,数组形式
|
|
14
15
|
indexList: {
|
|
15
16
|
type: Array,
|
|
16
|
-
default:
|
|
17
|
+
default: defprops.indexList.indexList
|
|
17
18
|
},
|
|
18
19
|
// 是否开启锚点自动吸顶
|
|
19
20
|
sticky: {
|
|
20
21
|
type: Boolean,
|
|
21
|
-
default:
|
|
22
|
+
default: defprops.indexList.sticky
|
|
22
23
|
},
|
|
23
24
|
// 自定义导航栏的高度
|
|
24
25
|
customNavHeight: {
|
|
25
26
|
type: [String, Number],
|
|
26
|
-
default:
|
|
27
|
+
default: defprops.indexList.customNavHeight
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -101,6 +101,8 @@
|
|
|
101
101
|
return indexList;
|
|
102
102
|
}
|
|
103
103
|
import props from './props.js';
|
|
104
|
+
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
105
|
+
import mixin from '../../libs/mixin/mixin.js';
|
|
104
106
|
// #ifdef APP-NVUE
|
|
105
107
|
// 由于weex为阿里的KPI业绩考核的产物,所以不支持百分比单位,这里需要通过dom查询组件的宽度
|
|
106
108
|
const dom = uni.requireNativePlugin('dom')
|
|
@@ -117,7 +119,7 @@
|
|
|
117
119
|
* */
|
|
118
120
|
export default {
|
|
119
121
|
name: 'u-index-list',
|
|
120
|
-
mixins: [
|
|
122
|
+
mixins: [mpMixin, mixin, props],
|
|
121
123
|
// #ifdef MP-WEIXIN
|
|
122
124
|
// 将自定义节点设置成虚拟的,更加接近Vue组件的表现,能更好的使用flex属性
|
|
123
125
|
options: {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import defprops from '../../libs/config/props';
|
|
1
2
|
export default {
|
|
2
3
|
props: {
|
|
3
4
|
// 输入的值
|
|
4
5
|
value: {
|
|
5
6
|
type: [String, Number],
|
|
6
|
-
default:
|
|
7
|
+
default: defprops.input.value
|
|
7
8
|
},
|
|
8
9
|
modelValue: {
|
|
9
10
|
type: [String, Number],
|
|
10
|
-
default:
|
|
11
|
+
default: defprops.input.value
|
|
11
12
|
},
|
|
12
13
|
// 输入框类型
|
|
13
14
|
// number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
|
|
@@ -16,171 +17,171 @@ export default {
|
|
|
16
17
|
// text-文本输入键盘
|
|
17
18
|
type: {
|
|
18
19
|
type: String,
|
|
19
|
-
default:
|
|
20
|
+
default: defprops.input.type
|
|
20
21
|
},
|
|
21
22
|
// 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,
|
|
22
23
|
// 兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序
|
|
23
24
|
fixed: {
|
|
24
25
|
type: Boolean,
|
|
25
|
-
default:
|
|
26
|
+
default: defprops.input.fixed
|
|
26
27
|
},
|
|
27
28
|
// 是否禁用输入框
|
|
28
29
|
disabled: {
|
|
29
30
|
type: Boolean,
|
|
30
|
-
default:
|
|
31
|
+
default: defprops.input.disabled
|
|
31
32
|
},
|
|
32
33
|
// 禁用状态时的背景色
|
|
33
34
|
disabledColor: {
|
|
34
35
|
type: String,
|
|
35
|
-
default:
|
|
36
|
+
default: defprops.input.disabledColor
|
|
36
37
|
},
|
|
37
38
|
// 是否显示清除控件
|
|
38
39
|
clearable: {
|
|
39
40
|
type: Boolean,
|
|
40
|
-
default:
|
|
41
|
+
default: defprops.input.clearable
|
|
41
42
|
},
|
|
42
43
|
// 是否密码类型
|
|
43
44
|
password: {
|
|
44
45
|
type: Boolean,
|
|
45
|
-
default:
|
|
46
|
+
default: defprops.input.password
|
|
46
47
|
},
|
|
47
48
|
// 最大输入长度,设置为 -1 的时候不限制最大长度
|
|
48
49
|
maxlength: {
|
|
49
50
|
type: [String, Number],
|
|
50
|
-
default:
|
|
51
|
+
default: defprops.input.maxlength
|
|
51
52
|
},
|
|
52
53
|
// 输入框为空时的占位符
|
|
53
54
|
placeholder: {
|
|
54
55
|
type: String,
|
|
55
|
-
default:
|
|
56
|
+
default: defprops.input.placeholder
|
|
56
57
|
},
|
|
57
58
|
// 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
|
|
58
59
|
placeholderClass: {
|
|
59
60
|
type: String,
|
|
60
|
-
default:
|
|
61
|
+
default: defprops.input.placeholderClass
|
|
61
62
|
},
|
|
62
63
|
// 指定placeholder的样式
|
|
63
64
|
placeholderStyle: {
|
|
64
65
|
type: [String, Object],
|
|
65
|
-
default:
|
|
66
|
+
default: defprops.input.placeholderStyle
|
|
66
67
|
},
|
|
67
68
|
// 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效
|
|
68
69
|
showWordLimit: {
|
|
69
70
|
type: Boolean,
|
|
70
|
-
default:
|
|
71
|
+
default: defprops.input.showWordLimit
|
|
71
72
|
},
|
|
72
73
|
// 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
|
|
73
74
|
// https://uniapp.dcloud.io/component/input
|
|
74
75
|
// https://uniapp.dcloud.io/component/textarea
|
|
75
76
|
confirmType: {
|
|
76
77
|
type: String,
|
|
77
|
-
default:
|
|
78
|
+
default: defprops.input.confirmType
|
|
78
79
|
},
|
|
79
80
|
// 点击键盘右下角按钮时是否保持键盘不收起,H5无效
|
|
80
81
|
confirmHold: {
|
|
81
82
|
type: Boolean,
|
|
82
|
-
default:
|
|
83
|
+
default: defprops.input.confirmHold
|
|
83
84
|
},
|
|
84
85
|
// focus时,点击页面的时候不收起键盘,微信小程序有效
|
|
85
86
|
holdKeyboard: {
|
|
86
87
|
type: Boolean,
|
|
87
|
-
default:
|
|
88
|
+
default: defprops.input.holdKeyboard
|
|
88
89
|
},
|
|
89
90
|
// 自动获取焦点
|
|
90
91
|
// 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
|
|
91
92
|
focus: {
|
|
92
93
|
type: Boolean,
|
|
93
|
-
default:
|
|
94
|
+
default: defprops.input.focus
|
|
94
95
|
},
|
|
95
96
|
// 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
|
|
96
97
|
autoBlur: {
|
|
97
98
|
type: Boolean,
|
|
98
|
-
default:
|
|
99
|
+
default: defprops.input.autoBlur
|
|
99
100
|
},
|
|
100
101
|
// 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效
|
|
101
102
|
disableDefaultPadding: {
|
|
102
103
|
type: Boolean,
|
|
103
|
-
default:
|
|
104
|
+
default: defprops.input.disableDefaultPadding
|
|
104
105
|
},
|
|
105
106
|
// 指定focus时光标的位置
|
|
106
107
|
cursor: {
|
|
107
108
|
type: [String, Number],
|
|
108
|
-
default:
|
|
109
|
+
default: defprops.input.cursor
|
|
109
110
|
},
|
|
110
111
|
// 输入框聚焦时底部与键盘的距离
|
|
111
112
|
cursorSpacing: {
|
|
112
113
|
type: [String, Number],
|
|
113
|
-
default:
|
|
114
|
+
default: defprops.input.cursorSpacing
|
|
114
115
|
},
|
|
115
116
|
// 光标起始位置,自动聚集时有效,需与selection-end搭配使用
|
|
116
117
|
selectionStart: {
|
|
117
118
|
type: [String, Number],
|
|
118
|
-
default:
|
|
119
|
+
default: defprops.input.selectionStart
|
|
119
120
|
},
|
|
120
121
|
// 光标结束位置,自动聚集时有效,需与selection-start搭配使用
|
|
121
122
|
selectionEnd: {
|
|
122
123
|
type: [String, Number],
|
|
123
|
-
default:
|
|
124
|
+
default: defprops.input.selectionEnd
|
|
124
125
|
},
|
|
125
126
|
// 键盘弹起时,是否自动上推页面
|
|
126
127
|
adjustPosition: {
|
|
127
128
|
type: Boolean,
|
|
128
|
-
default:
|
|
129
|
+
default: defprops.input.adjustPosition
|
|
129
130
|
},
|
|
130
131
|
// 输入框内容对齐方式,可选值为:left|center|right
|
|
131
132
|
inputAlign: {
|
|
132
133
|
type: String,
|
|
133
|
-
default:
|
|
134
|
+
default: defprops.input.inputAlign
|
|
134
135
|
},
|
|
135
136
|
// 输入框字体的大小
|
|
136
137
|
fontSize: {
|
|
137
138
|
type: [String, Number],
|
|
138
|
-
default:
|
|
139
|
+
default: defprops.input.fontSize
|
|
139
140
|
},
|
|
140
141
|
// 输入框字体颜色
|
|
141
142
|
color: {
|
|
142
143
|
type: String,
|
|
143
|
-
default:
|
|
144
|
+
default: defprops.input.color
|
|
144
145
|
},
|
|
145
146
|
// 输入框前置图标
|
|
146
147
|
prefixIcon: {
|
|
147
148
|
type: String,
|
|
148
|
-
default:
|
|
149
|
+
default: defprops.input.prefixIcon
|
|
149
150
|
},
|
|
150
151
|
// 前置图标样式,对象或字符串
|
|
151
152
|
prefixIconStyle: {
|
|
152
153
|
type: [String, Object],
|
|
153
|
-
default:
|
|
154
|
+
default: defprops.input.prefixIconStyle
|
|
154
155
|
},
|
|
155
156
|
// 输入框后置图标
|
|
156
157
|
suffixIcon: {
|
|
157
158
|
type: String,
|
|
158
|
-
default:
|
|
159
|
+
default: defprops.input.suffixIcon
|
|
159
160
|
},
|
|
160
161
|
// 后置图标样式,对象或字符串
|
|
161
162
|
suffixIconStyle: {
|
|
162
163
|
type: [String, Object],
|
|
163
|
-
default:
|
|
164
|
+
default: defprops.input.suffixIconStyle
|
|
164
165
|
},
|
|
165
166
|
// 边框类型,surround-四周边框,bottom-底部边框,none-无边框
|
|
166
167
|
border: {
|
|
167
168
|
type: String,
|
|
168
|
-
default:
|
|
169
|
+
default: defprops.input.border
|
|
169
170
|
},
|
|
170
171
|
// 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
|
|
171
172
|
readonly: {
|
|
172
173
|
type: Boolean,
|
|
173
|
-
default:
|
|
174
|
+
default: defprops.input.readonly
|
|
174
175
|
},
|
|
175
176
|
// 输入框形状,circle-圆形,square-方形
|
|
176
177
|
shape: {
|
|
177
178
|
type: String,
|
|
178
|
-
default:
|
|
179
|
+
default: defprops.input.shape
|
|
179
180
|
},
|
|
180
181
|
// 用于处理或者过滤输入框内容的方法
|
|
181
182
|
formatter: {
|
|
182
183
|
type: [Function, null],
|
|
183
|
-
default:
|
|
184
|
+
default: defprops.input.formatter
|
|
184
185
|
},
|
|
185
186
|
// 是否忽略组件内对文本合成系统事件的处理
|
|
186
187
|
ignoreCompositionEvent: {
|
|
@@ -76,6 +76,8 @@
|
|
|
76
76
|
|
|
77
77
|
<script>
|
|
78
78
|
import props from "./props.js";
|
|
79
|
+
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
80
|
+
import mixin from '../../libs/mixin/mixin.js';
|
|
79
81
|
/**
|
|
80
82
|
* Input 输入框
|
|
81
83
|
* @description 此组件为一个输入框,默认没有边框和样式,是专门为配合表单组件u-form而设计的,利用它可以快速实现表单验证,输入内容,下拉选择等功能。
|
|
@@ -120,7 +122,7 @@ import props from "./props.js";
|
|
|
120
122
|
*/
|
|
121
123
|
export default {
|
|
122
124
|
name: "u-input",
|
|
123
|
-
mixins: [
|
|
125
|
+
mixins: [mpMixin, mixin, props],
|
|
124
126
|
data() {
|
|
125
127
|
return {
|
|
126
128
|
// 输入框的值
|
|
@@ -1,84 +1,85 @@
|
|
|
1
|
+
import defprops from '../../libs/config/props';
|
|
1
2
|
export default {
|
|
2
3
|
props: {
|
|
3
4
|
// 键盘的类型,number-数字键盘,card-身份证键盘,car-车牌号键盘
|
|
4
5
|
mode: {
|
|
5
6
|
type: String,
|
|
6
|
-
default:
|
|
7
|
+
default: defprops.keyboard.mode
|
|
7
8
|
},
|
|
8
9
|
// 是否显示键盘的"."符号
|
|
9
10
|
dotDisabled: {
|
|
10
11
|
type: Boolean,
|
|
11
|
-
default:
|
|
12
|
+
default: defprops.keyboard.dotDisabled
|
|
12
13
|
},
|
|
13
14
|
// 是否显示顶部工具条
|
|
14
15
|
tooltip: {
|
|
15
16
|
type: Boolean,
|
|
16
|
-
default:
|
|
17
|
+
default: defprops.keyboard.tooltip
|
|
17
18
|
},
|
|
18
19
|
// 是否显示工具条中间的提示
|
|
19
20
|
showTips: {
|
|
20
21
|
type: Boolean,
|
|
21
|
-
default:
|
|
22
|
+
default: defprops.keyboard.showTips
|
|
22
23
|
},
|
|
23
24
|
// 工具条中间的提示文字
|
|
24
25
|
tips: {
|
|
25
26
|
type: String,
|
|
26
|
-
default:
|
|
27
|
+
default: defprops.keyboard.tips
|
|
27
28
|
},
|
|
28
29
|
// 是否显示工具条左边的"取消"按钮
|
|
29
30
|
showCancel: {
|
|
30
31
|
type: Boolean,
|
|
31
|
-
default:
|
|
32
|
+
default: defprops.keyboard.showCancel
|
|
32
33
|
},
|
|
33
34
|
// 是否显示工具条右边的"完成"按钮
|
|
34
35
|
showConfirm: {
|
|
35
36
|
type: Boolean,
|
|
36
|
-
default:
|
|
37
|
+
default: defprops.keyboard.showConfirm
|
|
37
38
|
},
|
|
38
39
|
// 是否打乱键盘按键的顺序
|
|
39
40
|
random: {
|
|
40
41
|
type: Boolean,
|
|
41
|
-
default:
|
|
42
|
+
default: defprops.keyboard.random
|
|
42
43
|
},
|
|
43
44
|
// 是否开启底部安全区适配,开启的话,会在iPhoneX机型底部添加一定的内边距
|
|
44
45
|
safeAreaInsetBottom: {
|
|
45
46
|
type: Boolean,
|
|
46
|
-
default:
|
|
47
|
+
default: defprops.keyboard.safeAreaInsetBottom
|
|
47
48
|
},
|
|
48
49
|
// 是否允许通过点击遮罩关闭键盘
|
|
49
50
|
closeOnClickOverlay: {
|
|
50
51
|
type: Boolean,
|
|
51
|
-
default:
|
|
52
|
+
default: defprops.keyboard.closeOnClickOverlay
|
|
52
53
|
},
|
|
53
54
|
// 控制键盘的弹出与收起
|
|
54
55
|
show: {
|
|
55
56
|
type: Boolean,
|
|
56
|
-
default:
|
|
57
|
+
default: defprops.keyboard.show
|
|
57
58
|
},
|
|
58
59
|
// 是否显示遮罩,某些时候数字键盘时,用户希望看到自己的数值,所以可能不想要遮罩
|
|
59
60
|
overlay: {
|
|
60
61
|
type: Boolean,
|
|
61
|
-
default:
|
|
62
|
+
default: defprops.keyboard.overlay
|
|
62
63
|
},
|
|
63
64
|
// z-index值
|
|
64
65
|
zIndex: {
|
|
65
66
|
type: [String, Number],
|
|
66
|
-
default:
|
|
67
|
+
default: defprops.keyboard.zIndex
|
|
67
68
|
},
|
|
68
69
|
// 取消按钮的文字
|
|
69
70
|
cancelText: {
|
|
70
71
|
type: String,
|
|
71
|
-
default:
|
|
72
|
+
default: defprops.keyboard.cancelText
|
|
72
73
|
},
|
|
73
74
|
// 确认按钮的文字
|
|
74
75
|
confirmText: {
|
|
75
76
|
type: String,
|
|
76
|
-
default:
|
|
77
|
+
default: defprops.keyboard.confirmText
|
|
77
78
|
},
|
|
78
79
|
// 输入一个中文后,是否自动切换到英文
|
|
79
80
|
autoChange: {
|
|
80
81
|
type: Boolean,
|
|
81
|
-
default:
|
|
82
|
+
default: defprops.keyboard.autoChange
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
}
|
|
@@ -69,6 +69,8 @@
|
|
|
69
69
|
|
|
70
70
|
<script>
|
|
71
71
|
import props from './props.js';
|
|
72
|
+
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
73
|
+
import mixin from '../../libs/mixin/mixin.js';
|
|
72
74
|
|
|
73
75
|
/**
|
|
74
76
|
* keyboard 键盘
|
|
@@ -103,7 +105,7 @@
|
|
|
103
105
|
|
|
104
106
|
}
|
|
105
107
|
},
|
|
106
|
-
mixins: [
|
|
108
|
+
mixins: [mpMixin, mixin, props],
|
|
107
109
|
methods: {
|
|
108
110
|
change(e) {
|
|
109
111
|
this.$emit('change', e);
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
+
import defprops from '../../libs/config/props';
|
|
1
2
|
export default {
|
|
2
3
|
props: {
|
|
3
4
|
color: {
|
|
4
5
|
type: String,
|
|
5
|
-
default:
|
|
6
|
+
default: defprops.line.color
|
|
6
7
|
},
|
|
7
8
|
// 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等
|
|
8
9
|
length: {
|
|
9
10
|
type: [String, Number],
|
|
10
|
-
default:
|
|
11
|
+
default: defprops.line.length
|
|
11
12
|
},
|
|
12
13
|
// 线条方向,col-竖向,row-横向
|
|
13
14
|
direction: {
|
|
14
15
|
type: String,
|
|
15
|
-
default:
|
|
16
|
+
default: defprops.line.direction
|
|
16
17
|
},
|
|
17
18
|
// 是否显示细边框
|
|
18
19
|
hairline: {
|
|
19
20
|
type: Boolean,
|
|
20
|
-
default:
|
|
21
|
+
default: defprops.line.hairline
|
|
21
22
|
},
|
|
22
23
|
// 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px"
|
|
23
24
|
margin: {
|
|
24
25
|
type: [String, Number],
|
|
25
|
-
default:
|
|
26
|
+
default: defprops.line.margin
|
|
26
27
|
},
|
|
27
28
|
// 是否虚线,true-虚线,false-实线
|
|
28
29
|
dashed: {
|
|
29
30
|
type: Boolean,
|
|
30
|
-
default:
|
|
31
|
+
default: defprops.line.dashed
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
}
|