uview-plus 3.4.49 → 3.4.51
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 +6 -0
- package/components/u-slider/u-slider.vue +10 -3
- package/components/u-subsection/props.js +5 -0
- package/components/u-subsection/subsection.js +1 -0
- package/components/u-subsection/u-subsection.vue +70 -10
- package/package.json +112 -95
- package/types/comps/subsection.d.ts +5 -0
package/changelog.md
CHANGED
|
@@ -149,20 +149,27 @@
|
|
|
149
149
|
// #ifdef VUE3
|
|
150
150
|
modelValue(n) {
|
|
151
151
|
// 只有在非滑动状态时,才可以通过value更新滑块值,这里监听,是为了让用户触发
|
|
152
|
-
if(this.status == 'end')
|
|
152
|
+
if (this.status == 'end') {
|
|
153
|
+
const $crtFmtValue = this.updateValue(this.modelValue, false);
|
|
154
|
+
this.$emit('change', $crtFmtValue);
|
|
155
|
+
}
|
|
153
156
|
},
|
|
154
157
|
// #endif
|
|
155
158
|
// #ifdef VUE2
|
|
156
159
|
value(n) {
|
|
157
160
|
// 只有在非滑动状态时,才可以通过value更新滑块值,这里监听,是为了让用户触发
|
|
158
|
-
if(this.status == 'end')
|
|
161
|
+
if (this.status == 'end') {
|
|
162
|
+
const $crtFmtValue = this.updateValue(this.value, false);
|
|
163
|
+
this.$emit('change', $crtFmtValue);
|
|
164
|
+
}
|
|
159
165
|
},
|
|
160
166
|
// #endif
|
|
161
167
|
rangeValue:{
|
|
162
168
|
handler(n){
|
|
163
|
-
if(this.status == 'end'){
|
|
169
|
+
if (this.status == 'end') {
|
|
164
170
|
this.updateValue(this.rangeValue[0], false, 0);
|
|
165
171
|
this.updateValue(this.rangeValue[1], false, 1);
|
|
172
|
+
this.$emit('change', this.rangeValue);
|
|
166
173
|
}
|
|
167
174
|
},
|
|
168
175
|
deep:true
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
'u-subsection__item--no-border-right',
|
|
32
32
|
index === 0 && 'u-subsection__item--first',
|
|
33
33
|
index === list.length - 1 && 'u-subsection__item--last',
|
|
34
|
+
getTextViewDisableClass(index),
|
|
34
35
|
]"
|
|
35
36
|
:ref="`u-subsection__item--${index}`"
|
|
36
37
|
:style="[itemStyle(index)]"
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
>
|
|
41
42
|
<text
|
|
42
43
|
class="u-subsection__item__text"
|
|
44
|
+
:class="[disabled ? 'u-subsection--disabled' : '']"
|
|
43
45
|
:style="[textStyle(index,item)]"
|
|
44
46
|
>{{ getText(item) }}</text
|
|
45
47
|
>
|
|
@@ -60,16 +62,19 @@ import { addStyle, addUnit, sleep } from '../../libs/function/index';
|
|
|
60
62
|
* Subsection 分段器
|
|
61
63
|
* @description 该分段器一般用于用户从几个选项中选择某一个的场景
|
|
62
64
|
* @tutorial https://ijry.github.io/uview-plus/components/subsection.html
|
|
63
|
-
* @property {Array} list
|
|
64
|
-
* @property {String | Number} current
|
|
65
|
-
* @property {String} activeColor
|
|
66
|
-
* @property {String} inactiveColor
|
|
67
|
-
* @property {String} mode
|
|
68
|
-
* @property {String | Number} fontSize
|
|
69
|
-
* @property {Boolean} bold
|
|
70
|
-
* @property {String} bgColor
|
|
71
|
-
* @property {Object} customStyle
|
|
72
|
-
* @property {String} keyName
|
|
65
|
+
* @property {Array} list tab的数据
|
|
66
|
+
* @property {String | Number} current 当前活动的tab的index(默认 0 )
|
|
67
|
+
* @property {String} activeColor 激活时的颜色(默认 '#3c9cff' )
|
|
68
|
+
* @property {String} inactiveColor 未激活时的颜色(默认 '#303133' )
|
|
69
|
+
* @property {String} mode 模式选择,mode=button为按钮形式,mode=subsection时为分段模式(默认 'button' )
|
|
70
|
+
* @property {String | Number} fontSize 字体大小,单位px(默认 12 )
|
|
71
|
+
* @property {Boolean} bold 激活选项的字体是否加粗(默认 true )
|
|
72
|
+
* @property {String} bgColor 组件背景颜色,mode为button时有效(默认 '#eeeeef' )
|
|
73
|
+
* @property {Object} customStyle 定义需要用到的外部样式
|
|
74
|
+
* @property {String} keyName 从`list`元素对象中读取的键名(默认 'name' )
|
|
75
|
+
* @property {String} activeColorKeyName 从`list`元素对象中读取激活时的颜色(默认 'activeColorKey' ) 如果存在字段 优先级大于 activeColor
|
|
76
|
+
* @property {String} inactiveColorKeyName 从`list`元素对象中读取未激活时的颜色 (默认 'inactiveColorKey' )如果存在字段 优先级大于 inactiveColor
|
|
77
|
+
* @property {Boolean} disabled 是否禁用分段器 (默认 false )
|
|
73
78
|
*
|
|
74
79
|
* @event {Function} change 分段器选项发生改变时触发 回调 index:选项的index索引值,从0开始
|
|
75
80
|
* @example <u-subsection :list="list" :current="curNow" @change="sectionChange"></u-subsection>
|
|
@@ -241,10 +246,31 @@ export default {
|
|
|
241
246
|
// #endif
|
|
242
247
|
},
|
|
243
248
|
clickHandler(index) {
|
|
249
|
+
// 防止某些平台 css 无法阻止点击事件 在此处拦截
|
|
250
|
+
if(this.disabled){
|
|
251
|
+
return
|
|
252
|
+
}
|
|
244
253
|
this.innerCurrent = index;
|
|
245
254
|
this.$emit('update:current', index);
|
|
246
255
|
this.$emit("change", index);
|
|
247
256
|
},
|
|
257
|
+
/**
|
|
258
|
+
* 获取当前文字区域的 class禁用样式
|
|
259
|
+
* @param index
|
|
260
|
+
*/
|
|
261
|
+
getTextViewDisableClass(index){
|
|
262
|
+
// 禁用状态下
|
|
263
|
+
if(this.disabled){
|
|
264
|
+
// 判断模式
|
|
265
|
+
if(this.mode === 'button'){
|
|
266
|
+
return 'item-button--disabled'
|
|
267
|
+
}
|
|
268
|
+
else{
|
|
269
|
+
return 'item-subsection--disabled'
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return '';
|
|
273
|
+
}
|
|
248
274
|
},
|
|
249
275
|
};
|
|
250
276
|
</script>
|
|
@@ -337,5 +363,39 @@ export default {
|
|
|
337
363
|
transition-duration: 0.3s;
|
|
338
364
|
}
|
|
339
365
|
}
|
|
366
|
+
|
|
367
|
+
// 禁用标志
|
|
368
|
+
//
|
|
369
|
+
//&--subsectio--disabled{
|
|
370
|
+
// cursor: no-drop;
|
|
371
|
+
// background: #FFFFFF !important;
|
|
372
|
+
// color: #BDBDBD !important;
|
|
373
|
+
// border-color: #BDBDBD !important;
|
|
374
|
+
//}
|
|
375
|
+
//
|
|
376
|
+
//&--button--disabled{
|
|
377
|
+
// cursor: no-drop;
|
|
378
|
+
// color: #BDBDBD !important;
|
|
379
|
+
// border-color: #BDBDBD !important;
|
|
380
|
+
//}
|
|
381
|
+
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.item-button--disabled{
|
|
385
|
+
cursor: no-drop;
|
|
386
|
+
color: #BDBDBD !important;
|
|
387
|
+
border-color: #BDBDBD !important;
|
|
388
|
+
text{
|
|
389
|
+
color: #BDBDBD !important;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
.item-subsection--disabled{
|
|
393
|
+
cursor: no-drop;
|
|
394
|
+
background: #FFFFFF !important;
|
|
395
|
+
color: #BDBDBD !important;
|
|
396
|
+
border-color: #BDBDBD !important;
|
|
397
|
+
text{
|
|
398
|
+
color: #BDBDBD !important;
|
|
399
|
+
}
|
|
340
400
|
}
|
|
341
401
|
</style>
|
package/package.json
CHANGED
|
@@ -1,96 +1,113 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
2
|
+
"id": "uview-plus",
|
|
3
|
+
"name": "uview-plus",
|
|
4
|
+
"displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙移动组件库。",
|
|
5
|
+
"version": "3.4.51",
|
|
6
|
+
"description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水。",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"uview",
|
|
9
|
+
"uview-plus",
|
|
10
|
+
"ui",
|
|
11
|
+
"ui",
|
|
12
|
+
"uni-app",
|
|
13
|
+
"uni-app",
|
|
14
|
+
"ui",
|
|
15
|
+
"可视化设计"
|
|
16
|
+
],
|
|
17
|
+
"main": "index.js",
|
|
18
|
+
"repository": "https://github.com/ijry/uview-plus",
|
|
19
|
+
"engines": {
|
|
20
|
+
"HBuilderX": "^3.1.0",
|
|
21
|
+
"uni-app": "^4.66",
|
|
22
|
+
"uni-app-x": ""
|
|
23
|
+
},
|
|
24
|
+
"dcloudext": {
|
|
25
|
+
"sale": {
|
|
26
|
+
"regular": {
|
|
27
|
+
"price": "0.00"
|
|
28
|
+
},
|
|
29
|
+
"sourcecode": {
|
|
30
|
+
"price": "0.00"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"contact": {
|
|
34
|
+
"qq": "598821125"
|
|
35
|
+
},
|
|
36
|
+
"declaration": {
|
|
37
|
+
"ads": "请注意本插件开发文档包含弹窗广告每日展示一次,源码纯净无广告。",
|
|
38
|
+
"data": "无",
|
|
39
|
+
"permissions": "无"
|
|
40
|
+
},
|
|
41
|
+
"npmurl": "https://www.npmjs.com/package/uview-plus",
|
|
42
|
+
"type": "component-vue",
|
|
43
|
+
"darkmode": "x",
|
|
44
|
+
"i18n": "x",
|
|
45
|
+
"widescreen": "x"
|
|
46
|
+
},
|
|
47
|
+
"uni_modules": {
|
|
48
|
+
"dependencies": [],
|
|
49
|
+
"encrypt": [],
|
|
50
|
+
"platforms": {
|
|
51
|
+
"cloud": {
|
|
52
|
+
"tcb": "√",
|
|
53
|
+
"aliyun": "√",
|
|
54
|
+
"alipay": "x"
|
|
55
|
+
},
|
|
56
|
+
"client": {
|
|
57
|
+
"uni-app": {
|
|
58
|
+
"vue": {
|
|
59
|
+
"vue2": "-",
|
|
60
|
+
"vue3": "√"
|
|
61
|
+
},
|
|
62
|
+
"web": {
|
|
63
|
+
"safari": "√",
|
|
64
|
+
"chrome": "√"
|
|
65
|
+
},
|
|
66
|
+
"app": {
|
|
67
|
+
"vue": "√",
|
|
68
|
+
"nvue": "√",
|
|
69
|
+
"android": "-",
|
|
70
|
+
"ios": "-",
|
|
71
|
+
"harmony": "√"
|
|
72
|
+
},
|
|
73
|
+
"mp": {
|
|
74
|
+
"weixin": "√",
|
|
75
|
+
"alipay": "√",
|
|
76
|
+
"toutiao": "√",
|
|
77
|
+
"baidu": "-",
|
|
78
|
+
"kuaishou": "-",
|
|
79
|
+
"jd": "-",
|
|
80
|
+
"harmony": "√",
|
|
81
|
+
"qq": "√",
|
|
82
|
+
"lark": "-"
|
|
83
|
+
},
|
|
84
|
+
"quickapp": {
|
|
85
|
+
"huawei": "-",
|
|
86
|
+
"union": "-"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"uni-app-x": {
|
|
90
|
+
"web": {
|
|
91
|
+
"safari": "-",
|
|
92
|
+
"chrome": "-"
|
|
93
|
+
},
|
|
94
|
+
"app": {
|
|
95
|
+
"android": "-",
|
|
96
|
+
"ios": "-",
|
|
97
|
+
"harmony": "-"
|
|
98
|
+
},
|
|
99
|
+
"mp": {
|
|
100
|
+
"weixin": "-"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"dependencies": {
|
|
107
|
+
"clipboard": "^2.0.11",
|
|
108
|
+
"dayjs": "^1.11.3"
|
|
109
|
+
},
|
|
110
|
+
"publishConfig": {
|
|
111
|
+
"registry": "https://registry.npmjs.org/"
|
|
112
|
+
}
|
|
113
|
+
}
|