uview-plus 3.1.35 → 3.1.37
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 +4 -0
- package/components/u-action-sheet/u-action-sheet.vue +1 -0
- package/components/u-album/u-album.vue +1 -0
- package/components/u-alert/u-alert.vue +1 -0
- package/components/u-avatar/u-avatar.vue +1 -0
- package/components/u-avatar-group/u-avatar-group.vue +1 -0
- package/components/u-back-top/u-back-top.vue +2 -1
- package/components/u-badge/u-badge.vue +1 -1
- package/components/u-calendar/u-calendar.vue +1 -0
- package/components/u-car-keyboard/u-car-keyboard.vue +312 -311
- package/components/u-cell/u-cell.vue +1 -1
- package/components/u-cell-group/u-cell-group.vue +1 -1
- package/components/u-checkbox/u-checkbox.vue +2 -1
- package/components/u-code/u-code.vue +1 -0
- package/components/u-code-input/props.js +13 -5
- package/components/u-code-input/u-code-input.vue +8 -2
- package/components/u-col/u-col.vue +1 -0
- package/components/u-collapse/u-collapse.vue +1 -0
- package/components/u-column-notice/u-column-notice.vue +1 -0
- package/components/u-count-down/u-count-down.vue +164 -163
- package/components/u-count-to/u-count-to.vue +1 -0
- package/components/u-divider/u-divider.vue +1 -0
- package/components/u-dropdown/u-dropdown.vue +127 -129
- package/components/u-form-item/u-form-item.vue +1 -0
- package/components/u-image/u-image.vue +1 -1
- package/components/u-index-anchor/u-index-anchor.vue +1 -1
- package/components/u-index-item/u-index-item.vue +1 -1
- package/components/u-index-list/u-index-list.vue +1 -1
- package/components/u-input/u-input.vue +3 -3
- package/components/u-keyboard/u-keyboard.vue +1 -0
- package/components/u-link/u-link.vue +1 -0
- package/components/u-list/u-list.vue +1 -0
- package/components/u-loadmore/u-loadmore.vue +1 -0
- package/components/u-modal/u-modal.vue +230 -229
- package/components/u-navbar/u-navbar.vue +1 -1
- package/components/u-no-network/u-no-network.vue +1 -0
- package/components/u-notice-bar/u-notice-bar.vue +1 -0
- package/components/u-number-box/u-number-box.vue +1 -1
- package/components/u-number-keyboard/u-number-keyboard.vue +1 -1
- package/components/u-overlay/u-overlay.vue +1 -0
- package/components/u-parse/node/node.vue +2 -2
- package/components/u-parse/parser.js +1333 -1333
- package/components/u-parse/u-parse.vue +5 -5
- package/components/u-popup/u-popup.vue +307 -306
- package/components/u-radio/u-radio.vue +1 -1
- package/components/u-read-more/u-read-more.vue +1 -0
- package/components/u-row/u-row.vue +1 -0
- package/components/u-row-notice/u-row-notice.vue +1 -0
- package/components/u-scroll-list/u-scroll-list.vue +1 -0
- package/components/u-search/u-search.vue +6 -2
- package/components/u-slider/props.js +13 -5
- package/components/u-slider/u-slider.vue +66 -55
- package/components/u-status-bar/u-status-bar.vue +1 -1
- package/components/u-steps/u-steps.vue +1 -1
- package/components/u-steps-item/u-steps-item.vue +1 -1
- package/components/u-subsection/u-subsection.vue +1 -0
- package/components/u-swiper/u-swiper.vue +10 -9
- package/components/u-tabbar-item/u-tabbar-item.vue +1 -0
- package/components/u-tag/u-tag.vue +362 -361
- package/components/u-toolbar/u-toolbar.vue +1 -0
- package/components/u-tooltip/u-tooltip.vue +1 -0
- package/components/u-upload/u-upload.vue +1 -1
- package/package.json +1 -1
|
@@ -1,129 +1,127 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="u-drawdown">
|
|
3
|
-
<view
|
|
4
|
-
class="u-dropdown__menu"
|
|
5
|
-
:style="{
|
|
6
|
-
height: $u.addUnit(height)
|
|
7
|
-
}"
|
|
8
|
-
ref="u-dropdown__menu"
|
|
9
|
-
>
|
|
10
|
-
<view
|
|
11
|
-
class="u-dropdown__menu__item"
|
|
12
|
-
v-for="(item, index) in menuList"
|
|
13
|
-
:key="index"
|
|
14
|
-
@tap.stop="clickHandler(item, index)"
|
|
15
|
-
>
|
|
16
|
-
<view class="u-dropdown__menu__item__content">
|
|
17
|
-
<text
|
|
18
|
-
class="u-dropdown__menu__item__content__text"
|
|
19
|
-
:style="[index === current ? activeStyle : inactiveStyle]"
|
|
20
|
-
>{{item.title}}</text>
|
|
21
|
-
<view
|
|
22
|
-
class="u-dropdown__menu__item__content__arrow"
|
|
23
|
-
:class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']"
|
|
24
|
-
>
|
|
25
|
-
<u-icon
|
|
26
|
-
:name="menuIcon"
|
|
27
|
-
:size="$u.addUnit(menuIconSize)"
|
|
28
|
-
></u-icon>
|
|
29
|
-
</view>
|
|
30
|
-
</view>
|
|
31
|
-
</view>
|
|
32
|
-
</view>
|
|
33
|
-
<view class="u-dropdown__content">
|
|
34
|
-
<slot />
|
|
35
|
-
</view>
|
|
36
|
-
</view>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script>
|
|
40
|
-
import props from './props.js';
|
|
41
|
-
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
42
|
-
import mixin from '../../libs/mixin/mixin.js';
|
|
43
|
-
/**
|
|
44
|
-
* Dropdown
|
|
45
|
-
* @description
|
|
46
|
-
* @tutorial url
|
|
47
|
-
* @property {String}
|
|
48
|
-
* @event {Function}
|
|
49
|
-
* @example
|
|
50
|
-
*/
|
|
51
|
-
export default {
|
|
52
|
-
name: 'u-dropdown',
|
|
53
|
-
mixins: [mixin, props],
|
|
54
|
-
data() {
|
|
55
|
-
return {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
child
|
|
74
|
-
child.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
child.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
//
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="u-drawdown">
|
|
3
|
+
<view
|
|
4
|
+
class="u-dropdown__menu"
|
|
5
|
+
:style="{
|
|
6
|
+
height: $u.addUnit(height)
|
|
7
|
+
}"
|
|
8
|
+
ref="u-dropdown__menu"
|
|
9
|
+
>
|
|
10
|
+
<view
|
|
11
|
+
class="u-dropdown__menu__item"
|
|
12
|
+
v-for="(item, index) in menuList"
|
|
13
|
+
:key="index"
|
|
14
|
+
@tap.stop="clickHandler(item, index)"
|
|
15
|
+
>
|
|
16
|
+
<view class="u-dropdown__menu__item__content">
|
|
17
|
+
<text
|
|
18
|
+
class="u-dropdown__menu__item__content__text"
|
|
19
|
+
:style="[index === current ? activeStyle : inactiveStyle]"
|
|
20
|
+
>{{item.title}}</text>
|
|
21
|
+
<view
|
|
22
|
+
class="u-dropdown__menu__item__content__arrow"
|
|
23
|
+
:class="[index === current && 'u-dropdown__menu__item__content__arrow--rotate']"
|
|
24
|
+
>
|
|
25
|
+
<u-icon
|
|
26
|
+
:name="menuIcon"
|
|
27
|
+
:size="$u.addUnit(menuIconSize)"
|
|
28
|
+
></u-icon>
|
|
29
|
+
</view>
|
|
30
|
+
</view>
|
|
31
|
+
</view>
|
|
32
|
+
</view>
|
|
33
|
+
<view class="u-dropdown__content">
|
|
34
|
+
<slot />
|
|
35
|
+
</view>
|
|
36
|
+
</view>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import props from './props.js';
|
|
41
|
+
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
42
|
+
import mixin from '../../libs/mixin/mixin.js';
|
|
43
|
+
/**
|
|
44
|
+
* Dropdown
|
|
45
|
+
* @description
|
|
46
|
+
* @tutorial url
|
|
47
|
+
* @property {String}
|
|
48
|
+
* @event {Function}
|
|
49
|
+
* @example
|
|
50
|
+
*/
|
|
51
|
+
export default {
|
|
52
|
+
name: 'u-dropdown',
|
|
53
|
+
mixins: [mixin, props],
|
|
54
|
+
data() {
|
|
55
|
+
return {
|
|
56
|
+
menuList: [],
|
|
57
|
+
current: 0
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
computed: {
|
|
61
|
+
|
|
62
|
+
},
|
|
63
|
+
created() {
|
|
64
|
+
this.children = [];
|
|
65
|
+
},
|
|
66
|
+
emits: ["click"],
|
|
67
|
+
methods: {
|
|
68
|
+
clickHandler(item, index) {
|
|
69
|
+
this.children.map(child => {
|
|
70
|
+
if(child.title === item.title) {
|
|
71
|
+
// this.queryRect('u-dropdown__menu').then(size => {
|
|
72
|
+
child.$emit('click')
|
|
73
|
+
child.setContentAnimate(child.show ? 0 : 300)
|
|
74
|
+
child.show = !child.show
|
|
75
|
+
// })
|
|
76
|
+
} else {
|
|
77
|
+
child.show = false
|
|
78
|
+
child.setContentAnimate(0)
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
},
|
|
82
|
+
//
|
|
83
|
+
queryRect(el) {
|
|
84
|
+
// #ifndef APP-NVUE
|
|
85
|
+
// $uGetRect?uView https://ijry.github.io/uview-plus/.uviewui.com/js/getRect.html
|
|
86
|
+
// this.$uGetRect this.$u.getRect
|
|
87
|
+
return new Promise(resolve => {
|
|
88
|
+
this.$uGetRect(`.${el}`).then(size => {
|
|
89
|
+
resolve(size)
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
// #endif
|
|
93
|
+
|
|
94
|
+
// #ifdef APP-NVUE
|
|
95
|
+
// promisethen
|
|
96
|
+
return new Promise(resolve => {
|
|
97
|
+
dom.getComponentRect(this.$refs[el], res => {
|
|
98
|
+
resolve(res.size)
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
// #endif
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<style lang="scss">
|
|
108
|
+
@import '../../libs/css/components.scss';
|
|
109
|
+
|
|
110
|
+
.u-dropdown {
|
|
111
|
+
|
|
112
|
+
&__menu {
|
|
113
|
+
@include flex;
|
|
114
|
+
|
|
115
|
+
&__item {
|
|
116
|
+
flex: 1;
|
|
117
|
+
@include flex;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
|
|
120
|
+
&__content {
|
|
121
|
+
@include flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
/**
|
|
71
71
|
* Image 图片
|
|
72
72
|
* @description 此组件为uni-app的image组件的加强版,在继承了原有功能外,还支持淡入动画、加载中、加载失败提示、圆角值和形状等。
|
|
73
|
-
* @tutorial https://
|
|
73
|
+
* @tutorial https://uiadmin.net/uview-plus/components/image.html
|
|
74
74
|
* @property {String} src 图片地址
|
|
75
75
|
* @property {String} mode 裁剪模式,见官网说明 (默认 'aspectFill' )
|
|
76
76
|
* @property {String | Number} width 宽度,单位任意,如果为数值,则为px单位 (默认 '300' )
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
/**
|
|
34
34
|
* IndexAnchor 列表锚点
|
|
35
35
|
* @description
|
|
36
|
-
* @tutorial https://
|
|
36
|
+
* @tutorial https://uiadmin.net/uview-plus/components/indexList.html
|
|
37
37
|
* @property {String | Number} text 列表锚点文本内容
|
|
38
38
|
* @property {String} color 列表锚点文字颜色 ( 默认 '#606266' )
|
|
39
39
|
* @property {String | Number} size 列表锚点文字大小,单位默认px ( 默认 14 )
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
/**
|
|
111
111
|
* IndexList 索引列表
|
|
112
112
|
* @description 通过折叠面板收纳内容区域
|
|
113
|
-
* @tutorial https://
|
|
113
|
+
* @tutorial https://uiadmin.net/uview-plus/components/indexList.html
|
|
114
114
|
* @property {String} inactiveColor 右边锚点非激活的颜色 ( 默认 '#606266' )
|
|
115
115
|
* @property {String} activeColor 右边锚点激活的颜色 ( 默认 '#5677fc' )
|
|
116
116
|
* @property {Array} indexList 索引字符列表,数组形式
|
|
@@ -81,7 +81,7 @@ import mixin from '../../libs/mixin/mixin.js';
|
|
|
81
81
|
/**
|
|
82
82
|
* Input 输入框
|
|
83
83
|
* @description 此组件为一个输入框,默认没有边框和样式,是专门为配合表单组件u-form而设计的,利用它可以快速实现表单验证,输入内容,下拉选择等功能。
|
|
84
|
-
* @tutorial https://
|
|
84
|
+
* @tutorial https://uiadmin.net/uview-plus/components/input.html
|
|
85
85
|
* @property {String | Number} value 输入的值
|
|
86
86
|
* @property {String} type 输入框类型,见上方说明 ( 默认 'text' )
|
|
87
87
|
* @property {Boolean} fixed 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 ( 默认 false )
|
|
@@ -271,8 +271,8 @@ export default {
|
|
|
271
271
|
},
|
|
272
272
|
// 键盘高度发生变化的时候触发此事件
|
|
273
273
|
// 兼容性:微信小程序2.7.0+、App 3.1.0+
|
|
274
|
-
onkeyboardheightchange() {
|
|
275
|
-
this.$emit("keyboardheightchange");
|
|
274
|
+
onkeyboardheightchange(event) {
|
|
275
|
+
this.$emit("keyboardheightchange", event);
|
|
276
276
|
},
|
|
277
277
|
// 内容发生变化,进行处理
|
|
278
278
|
valueChange() {
|