uview-plus 3.3.68 → 3.3.69
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 +7 -0
- package/components/u-datetime-picker/props.js +4 -0
- package/components/u-datetime-picker/u-datetime-picker.vue +1 -0
- package/components/u-picker/props.js +4 -0
- package/components/u-picker/u-picker.vue +1 -1
- package/components/u-select/u-select.vue +135 -0
- package/components/u-slider/u-slider.vue +4 -3
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<view class="u-picker-warrper">
|
|
3
3
|
<view v-if="hasInput" class="u-picker-input cursor-pointer" @click="onShowByClickInput">
|
|
4
4
|
<slot>
|
|
5
|
-
<up-input :disabled="disabled" :placeholder="placeholder" :readonly="true" border="surround" v-model="inputLabel"></up-input>
|
|
5
|
+
<up-input :disabled="disabled" :disabledColor="disabledColor" :placeholder="placeholder" :readonly="true" border="surround" v-model="inputLabel"></up-input>
|
|
6
6
|
<div class="input-cover"></div>
|
|
7
7
|
</slot>
|
|
8
8
|
</view>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="u-select">
|
|
3
|
+
<view class="u-select__content">
|
|
4
|
+
<view class="u-select__label" @click="openSelect">
|
|
5
|
+
<slot name="text">
|
|
6
|
+
<text class="u-select__text">
|
|
7
|
+
{{ label }}
|
|
8
|
+
</text>
|
|
9
|
+
</slot>
|
|
10
|
+
<slot name="icon">
|
|
11
|
+
<u-icon name="arrow-down" :size="iconSize" :color="iconColor"></u-icon>
|
|
12
|
+
</slot>
|
|
13
|
+
</view>
|
|
14
|
+
<view class="u-select__options"
|
|
15
|
+
:style="{zIndex: zIndex}" v-if="isOpen">
|
|
16
|
+
<slot name="options">
|
|
17
|
+
<view class="u-select__options_item"
|
|
18
|
+
:class="current == item[keyName] ? 'active': ''"
|
|
19
|
+
:key="index" v-for="(item, index) in options"
|
|
20
|
+
@click="selectItem(item)">
|
|
21
|
+
<slot name="optionItem" :item="item">
|
|
22
|
+
<text class="u-select__item_text" :style="{color: itemColor}">
|
|
23
|
+
{{item.name}}
|
|
24
|
+
</text>
|
|
25
|
+
</slot>
|
|
26
|
+
</view>
|
|
27
|
+
</slot>
|
|
28
|
+
</view>
|
|
29
|
+
</view>
|
|
30
|
+
</view>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
export default {
|
|
35
|
+
name:"up-select",
|
|
36
|
+
emits: ['update:current', 'select'],
|
|
37
|
+
props: {
|
|
38
|
+
label: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '选项'
|
|
41
|
+
},
|
|
42
|
+
options: {
|
|
43
|
+
type: Array,
|
|
44
|
+
default: () => {
|
|
45
|
+
return []
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
keyName: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'id'
|
|
51
|
+
},
|
|
52
|
+
current: {
|
|
53
|
+
type: [String, Number],
|
|
54
|
+
default: ''
|
|
55
|
+
},
|
|
56
|
+
zIndex: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: 10
|
|
59
|
+
},
|
|
60
|
+
itemColor: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '#333333'
|
|
63
|
+
},
|
|
64
|
+
iconColor: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: ''
|
|
67
|
+
},
|
|
68
|
+
iconSize: {
|
|
69
|
+
type: [String],
|
|
70
|
+
default: '13px'
|
|
71
|
+
}
|
|
72
|
+
} ,
|
|
73
|
+
data() {
|
|
74
|
+
return {
|
|
75
|
+
isOpen: false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
mounted() {
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
openSelect() {
|
|
82
|
+
this.isOpen = !this.isOpen
|
|
83
|
+
},
|
|
84
|
+
selectItem(item) {
|
|
85
|
+
this.isOpen = false
|
|
86
|
+
this.$emit('update:current', item[this.keyName])
|
|
87
|
+
this.$emit('select', item)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<style lang="scss" scoped>
|
|
94
|
+
.u-select__content {
|
|
95
|
+
position: relative;
|
|
96
|
+
.u-select__label {
|
|
97
|
+
display: flex;
|
|
98
|
+
/* #ifdef H5 */
|
|
99
|
+
&:hover {
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
}
|
|
102
|
+
/* #endif */
|
|
103
|
+
}
|
|
104
|
+
.u-select__text {
|
|
105
|
+
margin-right: 2px;
|
|
106
|
+
}
|
|
107
|
+
.u-select__options {
|
|
108
|
+
min-width: 100px;
|
|
109
|
+
border-radius: 4px;
|
|
110
|
+
border: 1px solid #f1f1f1;
|
|
111
|
+
background-color: #fff;
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 20px;
|
|
114
|
+
left: 0;
|
|
115
|
+
.u-select__options_item {
|
|
116
|
+
padding: 10px 12px;
|
|
117
|
+
width: 100%;
|
|
118
|
+
height: 100%;
|
|
119
|
+
&:hover {
|
|
120
|
+
background-color: #f7f7f7;
|
|
121
|
+
}
|
|
122
|
+
/* #ifdef H5 */
|
|
123
|
+
&:hover {
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
}
|
|
126
|
+
.u-select__item_text {
|
|
127
|
+
&:hover {
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/* #endif */
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
</style>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
<view class="u-slider__button-wrap u-slider__button-wrap-0" @touchstart="onTouchStart($event, 0)"
|
|
59
59
|
@touchmove="onTouchMove($event, 0)" @touchend="onTouchEnd($event, 0)"
|
|
60
60
|
@touchcancel="onTouchEnd($event, 0)" :style="{left: (getPx(barStyle0.width) + getPx(blockSize)/2) + 'px'}">
|
|
61
|
-
<slot v-if="$slots.
|
|
61
|
+
<slot name="min" v-if="$slots.min || $slots.$min"/>
|
|
62
62
|
<view v-else class="u-slider__button" :style="[blockStyle, {
|
|
63
63
|
height: getPx(blockSize, true),
|
|
64
64
|
width: getPx(blockSize, true),
|
|
@@ -69,7 +69,8 @@
|
|
|
69
69
|
<view class="u-slider__button-wrap" @touchstart="onTouchStart"
|
|
70
70
|
@touchmove="onTouchMove" @touchend="onTouchEnd"
|
|
71
71
|
@touchcancel="onTouchEnd" :style="{left: (getPx(barStyle.width) + getPx(blockSize)/2) + 'px'}">
|
|
72
|
-
<slot v-if="$slots.
|
|
72
|
+
<slot name="max" v-if="isRange && ($slots.max || $slots.$max)"/>
|
|
73
|
+
<slot v-else-if="$slots.default || $slots.$default"/>
|
|
73
74
|
<view v-else class="u-slider__button" :style="[blockStyle, {
|
|
74
75
|
height: getPx(blockSize, true),
|
|
75
76
|
width: getPx(blockSize, true),
|
|
@@ -386,7 +387,7 @@
|
|
|
386
387
|
return this.rangeValue
|
|
387
388
|
} else {
|
|
388
389
|
return valueFormat
|
|
389
|
-
}
|
|
390
|
+
}
|
|
390
391
|
},
|
|
391
392
|
format(value, index = 1) {
|
|
392
393
|
// 将小数变成整数,为了减少对视图的更新,造成视图层与逻辑层的阻塞
|
package/package.json
CHANGED