uview-plus 3.1.52 → 3.2.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 +44 -0
- package/components/u-action-sheet/u-action-sheet.vue +1 -1
- package/components/u-album/u-album.vue +261 -261
- package/components/u-avatar/u-avatar.vue +3 -2
- package/components/u-avatar-group/u-avatar-group.vue +106 -106
- package/components/u-button/u-button.vue +6 -1
- package/components/u-calendar/u-calendar.vue +4 -3
- package/components/u-cell/u-cell.vue +4 -2
- package/components/u-checkbox/props.js +5 -0
- package/components/u-checkbox/u-checkbox.vue +27 -15
- package/components/u-code/u-code.vue +1 -1
- package/components/u-dropdown/props.js +8 -14
- package/components/u-dropdown/u-dropdown.vue +202 -77
- package/components/u-dropdown-item/props.js +45 -36
- package/components/u-dropdown-item/u-dropdown-item.vue +121 -148
- package/components/u-form/u-form.vue +1 -1
- package/components/u-form-item/props.js +6 -1
- package/components/u-form-item/u-form-item.vue +1 -1
- package/components/u-grid/u-grid.vue +4 -2
- package/components/u-grid-item/u-grid-item.vue +8 -7
- package/components/u-input/u-input.vue +1 -1
- package/components/u-lazy-load/u-lazy-load.vue +251 -0
- package/components/u-picker/u-picker.vue +4 -1
- package/components/u-popup/u-popup.vue +1 -1
- package/components/u-read-more/u-read-more.vue +164 -160
- package/components/u-slider/u-slider.vue +6 -6
- package/components/u-steps-item/u-steps-item.vue +318 -318
- package/components/u-subsection/u-subsection.vue +14 -8
- package/components/u-swiper/u-swiper.vue +6 -8
- package/components/u-tabs/u-tabs.vue +1 -0
- package/components/u-tag/props.js +5 -2
- package/components/u-text/u-text.vue +226 -226
- package/components/u-textarea/u-textarea.vue +275 -275
- package/components/u-transition/u-transition.vue +1 -1
- package/components/u-waterfall/u-waterfall.vue +225 -0
- package/libs/config/props/formItem.js +1 -0
- package/libs/config/props/tag.js +30 -29
- package/libs/css/common.scss +1 -1
- package/libs/css/components.scss +5 -5
- package/libs/css/flex.scss +45 -45
- package/libs/mixin/mixin.js +2 -2
- package/package.json +1 -1
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
:style="{
|
|
39
39
|
height: $u.addUnit(itemHeight),
|
|
40
40
|
lineHeight: $u.addUnit(itemHeight),
|
|
41
|
-
fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal'
|
|
41
|
+
fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal',
|
|
42
|
+
display: 'block'
|
|
42
43
|
}"
|
|
43
44
|
>{{ getItemText(item1) }}</view>
|
|
44
45
|
</picker-view-column>
|
|
@@ -194,6 +195,8 @@ export default {
|
|
|
194
195
|
setColumnValues(columnIndex, values) {
|
|
195
196
|
// 替换innerColumns数组中columnIndex索引的值为values,使用的是数组的splice方法
|
|
196
197
|
this.innerColumns.splice(columnIndex, 1, values)
|
|
198
|
+
// 替换完成之后将修改列之后的已选值置空
|
|
199
|
+
this.setLastIndex(this.innerIndex.slice(0, columnIndex))
|
|
197
200
|
// 拷贝一份原有的innerIndex做临时变量,将大于当前变化列的所有的列的默认索引设置为0
|
|
198
201
|
let tmpIndex = uni.$u.deepClone(this.innerIndex)
|
|
199
202
|
for (let i = 0; i < this.innerColumns.length; i++) {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
* @property {Boolean} overlay 是否显示遮罩 (默认 true )
|
|
58
58
|
* @property {String} mode 弹出方向(默认 'bottom' )
|
|
59
59
|
* @property {String | Number} duration 动画时长,单位ms (默认 300 )
|
|
60
|
-
* @property {String | Number} overlayDuration
|
|
60
|
+
* @property {String | Number} overlayDuration 遮罩层动画时长,单位ms (默认 350 )
|
|
61
61
|
* @property {Boolean} closeable 是否显示关闭图标(默认 false )
|
|
62
62
|
* @property {Object | String} overlayStyle 自定义遮罩的样式
|
|
63
63
|
* @property {String | Number} overlayOpacity 遮罩透明度,0-1之间(默认 0.5)
|
|
@@ -1,160 +1,164 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="u-read-more">
|
|
3
|
-
<view
|
|
4
|
-
class="u-read-more__content"
|
|
5
|
-
:style="{
|
|
6
|
-
height: isLongContent && status === 'close' ? $u.addUnit(showHeight) : $u.addUnit(contentHeight),
|
|
7
|
-
textIndent: textIndent
|
|
8
|
-
}"
|
|
9
|
-
>
|
|
10
|
-
<view
|
|
11
|
-
class="u-read-more__content__inner"
|
|
12
|
-
ref="u-read-more__content__inner"
|
|
13
|
-
:class="[elId]"
|
|
14
|
-
>
|
|
15
|
-
<slot></slot>
|
|
16
|
-
</view>
|
|
17
|
-
</view>
|
|
18
|
-
<view
|
|
19
|
-
class="u-read-more__toggle"
|
|
20
|
-
:style="[innerShadowStyle]"
|
|
21
|
-
v-if="isLongContent"
|
|
22
|
-
>
|
|
23
|
-
<slot name="toggle">
|
|
24
|
-
<view
|
|
25
|
-
class="u-read-more__toggle__text"
|
|
26
|
-
@tap="toggleReadMore"
|
|
27
|
-
>
|
|
28
|
-
<
|
|
29
|
-
:text="status === 'close' ? closeText : openText"
|
|
30
|
-
:color="color"
|
|
31
|
-
:size="fontSize"
|
|
32
|
-
:lineHeight="fontSize"
|
|
33
|
-
margin="0 5px 0 0"
|
|
34
|
-
></
|
|
35
|
-
<view class="u-read-more__toggle__icon">
|
|
36
|
-
<u-icon
|
|
37
|
-
:color="color"
|
|
38
|
-
:size="fontSize + 2"
|
|
39
|
-
:name="status === 'close' ? 'arrow-down' : 'arrow-up'"
|
|
40
|
-
></u-icon>
|
|
41
|
-
</view>
|
|
42
|
-
</view>
|
|
43
|
-
</slot>
|
|
44
|
-
</view>
|
|
45
|
-
</view>
|
|
46
|
-
</template>
|
|
47
|
-
|
|
48
|
-
<script>
|
|
49
|
-
// #ifdef APP-NVUE
|
|
50
|
-
const dom = uni.requireNativePlugin('dom')
|
|
51
|
-
// #endif
|
|
52
|
-
import props from './props.js';
|
|
53
|
-
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
54
|
-
import mixin from '../../libs/mixin/mixin.js';
|
|
55
|
-
/**
|
|
56
|
-
* readMore 阅读更多
|
|
57
|
-
* @description 该组件一般用于内容较长,预先收起一部分,点击展开全部内容的场景。
|
|
58
|
-
* @tutorial https://ijry.github.io/uview-plus/components/readMore.html
|
|
59
|
-
* @property {String | Number} showHeight 内容超出此高度才会显示展开全文按钮,单位px(默认 400 )
|
|
60
|
-
* @property {Boolean} toggle 展开后是否显示收起按钮(默认 false )
|
|
61
|
-
* @property {String} closeText 关闭时的提示文字(默认 '展开阅读全文' )
|
|
62
|
-
* @property {String} openText 展开时的提示文字(默认 '收起' )
|
|
63
|
-
* @property {String} color 提示文字的颜色(默认 '#2979ff' )
|
|
64
|
-
* @property {String | Number} fontSize 提示文字的大小,单位px (默认 14 )
|
|
65
|
-
* @property {Object} shadowStyle 显示阴影的样式
|
|
66
|
-
* @property {String} textIndent 段落首行缩进的字符个数 (默认 '2em' )
|
|
67
|
-
* @property {String | Number} name 用于在 open 和 close 事件中当作回调参数返回
|
|
68
|
-
* @event {Function} open 内容被展开时触发
|
|
69
|
-
* @event {Function} close 内容被收起时触发
|
|
70
|
-
* @example <u-read-more><rich-text :nodes="content"></rich-text></u-read-more>
|
|
71
|
-
*/
|
|
72
|
-
export default {
|
|
73
|
-
name: 'u-read-more',
|
|
74
|
-
mixins: [mpMixin, mixin, props],
|
|
75
|
-
data() {
|
|
76
|
-
return {
|
|
77
|
-
isLongContent: false, // 是否需要隐藏一部分内容
|
|
78
|
-
status: 'close', // 当前隐藏与显示的状态,close-收起状态,open-展开状态
|
|
79
|
-
elId: uni.$u.guid(), // 生成唯一class
|
|
80
|
-
contentHeight: 100, // 内容高度
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
computed: {
|
|
84
|
-
// 展开后无需阴影,收起时才需要阴影样式
|
|
85
|
-
innerShadowStyle() {
|
|
86
|
-
if (this.status === 'open') return {}
|
|
87
|
-
else return this.shadowStyle
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
mounted() {
|
|
91
|
-
this.init()
|
|
92
|
-
},
|
|
93
|
-
emits: ["open", "close"],
|
|
94
|
-
methods: {
|
|
95
|
-
async init() {
|
|
96
|
-
this.getContentHeight().then(height => {
|
|
97
|
-
this.contentHeight = height
|
|
98
|
-
// 判断高度,如果真实内容高度大于占位高度,则显示收起与展开的控制按钮
|
|
99
|
-
if (height > uni.$u.getPx(this.showHeight)) {
|
|
100
|
-
this.isLongContent = true
|
|
101
|
-
this.status = 'close'
|
|
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
|
-
|
|
130
|
-
this
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<view class="u-read-more">
|
|
3
|
+
<view
|
|
4
|
+
class="u-read-more__content"
|
|
5
|
+
:style="{
|
|
6
|
+
height: isLongContent && status === 'close' ? $u.addUnit(showHeight) : $u.addUnit(contentHeight),
|
|
7
|
+
textIndent: textIndent
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<view
|
|
11
|
+
class="u-read-more__content__inner"
|
|
12
|
+
ref="u-read-more__content__inner"
|
|
13
|
+
:class="[elId]"
|
|
14
|
+
>
|
|
15
|
+
<slot></slot>
|
|
16
|
+
</view>
|
|
17
|
+
</view>
|
|
18
|
+
<view
|
|
19
|
+
class="u-read-more__toggle"
|
|
20
|
+
:style="[innerShadowStyle]"
|
|
21
|
+
v-if="isLongContent"
|
|
22
|
+
>
|
|
23
|
+
<slot name="toggle">
|
|
24
|
+
<view
|
|
25
|
+
class="u-read-more__toggle__text"
|
|
26
|
+
@tap="toggleReadMore"
|
|
27
|
+
>
|
|
28
|
+
<up-text
|
|
29
|
+
:text="status === 'close' ? closeText : openText"
|
|
30
|
+
:color="color"
|
|
31
|
+
:size="fontSize"
|
|
32
|
+
:lineHeight="fontSize"
|
|
33
|
+
margin="0 5px 0 0"
|
|
34
|
+
></up-text>
|
|
35
|
+
<view class="u-read-more__toggle__icon">
|
|
36
|
+
<u-icon
|
|
37
|
+
:color="color"
|
|
38
|
+
:size="fontSize + 2"
|
|
39
|
+
:name="status === 'close' ? 'arrow-down' : 'arrow-up'"
|
|
40
|
+
></u-icon>
|
|
41
|
+
</view>
|
|
42
|
+
</view>
|
|
43
|
+
</slot>
|
|
44
|
+
</view>
|
|
45
|
+
</view>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
// #ifdef APP-NVUE
|
|
50
|
+
const dom = uni.requireNativePlugin('dom')
|
|
51
|
+
// #endif
|
|
52
|
+
import props from './props.js';
|
|
53
|
+
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
54
|
+
import mixin from '../../libs/mixin/mixin.js';
|
|
55
|
+
/**
|
|
56
|
+
* readMore 阅读更多
|
|
57
|
+
* @description 该组件一般用于内容较长,预先收起一部分,点击展开全部内容的场景。
|
|
58
|
+
* @tutorial https://ijry.github.io/uview-plus/components/readMore.html
|
|
59
|
+
* @property {String | Number} showHeight 内容超出此高度才会显示展开全文按钮,单位px(默认 400 )
|
|
60
|
+
* @property {Boolean} toggle 展开后是否显示收起按钮(默认 false )
|
|
61
|
+
* @property {String} closeText 关闭时的提示文字(默认 '展开阅读全文' )
|
|
62
|
+
* @property {String} openText 展开时的提示文字(默认 '收起' )
|
|
63
|
+
* @property {String} color 提示文字的颜色(默认 '#2979ff' )
|
|
64
|
+
* @property {String | Number} fontSize 提示文字的大小,单位px (默认 14 )
|
|
65
|
+
* @property {Object} shadowStyle 显示阴影的样式
|
|
66
|
+
* @property {String} textIndent 段落首行缩进的字符个数 (默认 '2em' )
|
|
67
|
+
* @property {String | Number} name 用于在 open 和 close 事件中当作回调参数返回
|
|
68
|
+
* @event {Function} open 内容被展开时触发
|
|
69
|
+
* @event {Function} close 内容被收起时触发
|
|
70
|
+
* @example <u-read-more><rich-text :nodes="content"></rich-text></u-read-more>
|
|
71
|
+
*/
|
|
72
|
+
export default {
|
|
73
|
+
name: 'u-read-more',
|
|
74
|
+
mixins: [mpMixin, mixin, props],
|
|
75
|
+
data() {
|
|
76
|
+
return {
|
|
77
|
+
isLongContent: false, // 是否需要隐藏一部分内容
|
|
78
|
+
status: 'close', // 当前隐藏与显示的状态,close-收起状态,open-展开状态
|
|
79
|
+
elId: uni.$u.guid(), // 生成唯一class
|
|
80
|
+
contentHeight: 100, // 内容高度
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
computed: {
|
|
84
|
+
// 展开后无需阴影,收起时才需要阴影样式
|
|
85
|
+
innerShadowStyle() {
|
|
86
|
+
if (this.status === 'open') return {}
|
|
87
|
+
else return this.shadowStyle
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
mounted() {
|
|
91
|
+
this.init()
|
|
92
|
+
},
|
|
93
|
+
emits: ["open", "close"],
|
|
94
|
+
methods: {
|
|
95
|
+
async init() {
|
|
96
|
+
this.getContentHeight().then(height => {
|
|
97
|
+
this.contentHeight = height
|
|
98
|
+
// 判断高度,如果真实内容高度大于占位高度,则显示收起与展开的控制按钮
|
|
99
|
+
if (height > uni.$u.getPx(this.showHeight)) {
|
|
100
|
+
this.isLongContent = true
|
|
101
|
+
this.status = 'close'
|
|
102
|
+
} else {
|
|
103
|
+
// https://github.com/ijry/uview-plus/issues/270
|
|
104
|
+
this.isLongContent = false
|
|
105
|
+
this.status = 'close'
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
},
|
|
109
|
+
// 获取内容的高度
|
|
110
|
+
async getContentHeight() {
|
|
111
|
+
// 延时一定时间再获取节点
|
|
112
|
+
await uni.$u.sleep(30)
|
|
113
|
+
return new Promise(resolve => {
|
|
114
|
+
// #ifndef APP-NVUE
|
|
115
|
+
this.$uGetRect('.' + this.elId).then(res => {
|
|
116
|
+
resolve(res.height)
|
|
117
|
+
})
|
|
118
|
+
// #endif
|
|
119
|
+
|
|
120
|
+
// #ifdef APP-NVUE
|
|
121
|
+
const ref = this.$refs['u-read-more__content__inner']
|
|
122
|
+
dom.getComponentRect(ref, (res) => {
|
|
123
|
+
resolve(res.size.height)
|
|
124
|
+
})
|
|
125
|
+
// #endif
|
|
126
|
+
})
|
|
127
|
+
},
|
|
128
|
+
// 展开或者收起
|
|
129
|
+
toggleReadMore() {
|
|
130
|
+
this.status = this.status === 'close' ? 'open' : 'close'
|
|
131
|
+
// 如果toggle为false,隐藏"收起"部分的内容
|
|
132
|
+
if (this.toggle == false) this.isLongContent = false
|
|
133
|
+
// 发出打开或者收齐的事件
|
|
134
|
+
this.$emit(this.status, this.name)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
</script>
|
|
139
|
+
|
|
140
|
+
<style lang="scss" scoped>
|
|
141
|
+
@import "../../libs/css/components.scss";
|
|
142
|
+
|
|
143
|
+
.u-read-more {
|
|
144
|
+
|
|
145
|
+
&__content {
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
color: $u-content-color;
|
|
148
|
+
font-size: 15px;
|
|
149
|
+
text-align: left;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&__toggle {
|
|
153
|
+
@include flex;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
|
|
156
|
+
&__text {
|
|
157
|
+
@include flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
margin-top: 5px;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view
|
|
3
3
|
class="u-slider"
|
|
4
|
-
:style="[
|
|
4
|
+
:style="[addStyle(customStyle)]"
|
|
5
5
|
>
|
|
6
6
|
<slider
|
|
7
7
|
:min="min"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:value="modelValue"
|
|
11
11
|
:activeColor="activeColor"
|
|
12
12
|
:backgroundColor="inactiveColor"
|
|
13
|
-
:blockSize="
|
|
13
|
+
:blockSize="getPx(blockSize)"
|
|
14
14
|
:blockColor="blockColor"
|
|
15
15
|
:showValue="showValue"
|
|
16
16
|
:disabled="disabled"
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
</view>
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
|
-
<script>
|
|
23
|
+
<script>
|
|
24
24
|
import props from './props.js';
|
|
25
25
|
import mpMixin from '../../libs/mixin/mpMixin.js';
|
|
26
|
-
import mixin from '../../libs/mixin/mixin.js';
|
|
26
|
+
import mixin from '../../libs/mixin/mixin.js';
|
|
27
27
|
export default {
|
|
28
|
-
name: '
|
|
28
|
+
name: 'up-slider',
|
|
29
29
|
mixins: [mpMixin, mixin, props],
|
|
30
30
|
emits: ["changing", "change", "update:modelValue"],
|
|
31
|
-
methods: {
|
|
31
|
+
methods: {
|
|
32
32
|
// 拖动过程中触发
|
|
33
33
|
changingHandler(e) {
|
|
34
34
|
const {
|