hy-app 0.5.13 → 0.5.15
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/components/hy-address-picker/hy-address-picker.vue +0 -1
- package/components/hy-button/hy-button.vue +7 -1
- package/components/hy-button/index.scss +25 -21
- package/components/hy-cell-item/hy-cell-item.vue +161 -161
- package/components/hy-cell-item/props.ts +59 -66
- package/components/hy-code-input/hy-code-input.vue +231 -231
- package/components/hy-code-input/props.ts +90 -88
- package/components/hy-config-provider/index.scss +4 -7
- package/components/hy-datetime-picker/hy-datetime-picker.vue +519 -521
- package/components/hy-folding-panel/hy-folding-panel-group.vue +163 -0
- package/components/hy-icon/index.scss +1 -2
- package/components/hy-index-bar/hy-index-bar.vue +185 -0
- package/components/hy-index-bar/index.scss +65 -0
- package/components/hy-index-bar/props.ts +94 -0
- package/components/hy-index-bar/typing.d.ts +36 -0
- package/components/hy-notify/hy-notify.vue +174 -174
- package/components/hy-number-step/hy-number-step.vue +367 -367
- package/components/hy-number-step/index.scss +14 -5
- package/components/hy-picker/hy-picker.vue +0 -1
- package/components/hy-picker/index.scss +1 -1
- package/components/hy-qrcode/qrcode.js.bak +1434 -0
- package/components/hy-table/hy-table.vue +30 -13
- package/components/hy-table/index.scss +6 -1
- package/components/hy-table/props.ts +1 -1
- package/components/hy-tabs/index.scss +1 -0
- package/components/hy-tag/index.scss +4 -13
- package/components/hy-text/hy-text.vue +1 -1
- package/components/hy-textarea/hy-textarea.vue +1 -1
- package/components/hy-textarea/index.scss +1 -4
- package/global.d.ts +92 -91
- package/libs/css/iconfont.css +117 -119
- package/libs/utils/utils.ts +502 -521
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1,231 +1,231 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="hy-code-input">
|
|
3
|
-
<view
|
|
4
|
-
:class="itemClass(index)"
|
|
5
|
-
:style="[itemStyle(index)]"
|
|
6
|
-
v-for="(item, index) in codeLength"
|
|
7
|
-
:key="index"
|
|
8
|
-
>
|
|
9
|
-
<view
|
|
10
|
-
class="hy-code-input--item__dot"
|
|
11
|
-
v-if="dot && current > index"
|
|
12
|
-
:style="{ color: color }"
|
|
13
|
-
></view>
|
|
14
|
-
<text
|
|
15
|
-
v-else
|
|
16
|
-
class="hy-code-input--item__text"
|
|
17
|
-
:style="{
|
|
18
|
-
fontSize: addUnit(fontSize),
|
|
19
|
-
fontWeight: bold ? 'bold' : 'normal',
|
|
20
|
-
color: color
|
|
21
|
-
}"
|
|
22
|
-
>
|
|
23
|
-
{{ codeArray[index] }}
|
|
24
|
-
</text>
|
|
25
|
-
</view>
|
|
26
|
-
<input
|
|
27
|
-
:disabled="disabledKeyboard"
|
|
28
|
-
type="number"
|
|
29
|
-
:focus="focus"
|
|
30
|
-
:value="inputValue"
|
|
31
|
-
:maxlength="maxlength"
|
|
32
|
-
:adjustPosition="adjustPosition"
|
|
33
|
-
class="hy-code-input__input"
|
|
34
|
-
@input="inputHandler"
|
|
35
|
-
:style="{
|
|
36
|
-
height: boxSize
|
|
37
|
-
}"
|
|
38
|
-
@focus="isFocus = true"
|
|
39
|
-
@blur="isFocus = false"
|
|
40
|
-
/>
|
|
41
|
-
</view>
|
|
42
|
-
</template>
|
|
43
|
-
|
|
44
|
-
<script lang="ts">
|
|
45
|
-
export default {
|
|
46
|
-
name: 'hy-code-input',
|
|
47
|
-
options: {
|
|
48
|
-
addGlobalClass: true,
|
|
49
|
-
virtualHost: true,
|
|
50
|
-
styleIsolation: 'shared'
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<script setup lang="ts">
|
|
56
|
-
import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
|
|
57
|
-
import type { CSSProperties } from 'vue'
|
|
58
|
-
import type { ICodeInputEmits } from './typing'
|
|
59
|
-
import { addUnit, getPx } from '../../libs'
|
|
60
|
-
import type { InputOnInputEvent } from '@uni-helper/uni-types'
|
|
61
|
-
import codeInputProps from './props'
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 一般用于验证用户短信验证码的场景,也可以结合华玥的键盘组件使用
|
|
65
|
-
* @displayName hy-code-input
|
|
66
|
-
*/
|
|
67
|
-
defineOptions({})
|
|
68
|
-
|
|
69
|
-
const props = defineProps(codeInputProps)
|
|
70
|
-
const emit = defineEmits<ICodeInputEmits>()
|
|
71
|
-
|
|
72
|
-
const current = ref(0)
|
|
73
|
-
const inputValue = ref('')
|
|
74
|
-
const isFocus = ref(props.focus)
|
|
75
|
-
let timer: ReturnType<typeof setInterval>
|
|
76
|
-
const opacity = ref(1)
|
|
77
|
-
const borderWidth = computed(() => (props.hairline ? '0.5px' : '2px'))
|
|
78
|
-
const lineHeight = computed(() => (props.hairline ? '2px' : '4px'))
|
|
79
|
-
const boxSize = addUnit(props.size)
|
|
80
|
-
|
|
81
|
-
watch(
|
|
82
|
-
() => props.modelValue,
|
|
83
|
-
(newValue: string | number) => {
|
|
84
|
-
inputValue.value = String(newValue).substring(0, props.maxlength)
|
|
85
|
-
current.value = newValue.toString().length
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
{ immediate: true }
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
watch(
|
|
92
|
-
() => isFocus.value,
|
|
93
|
-
(newValue) => {
|
|
94
|
-
// #ifdef APP-NVUE
|
|
95
|
-
if (newValue) {
|
|
96
|
-
timer = setInterval(() => {
|
|
97
|
-
opacity.value = Math.abs(opacity.value - 1)
|
|
98
|
-
}, 600)
|
|
99
|
-
} else {
|
|
100
|
-
clearInterval(timer)
|
|
101
|
-
}
|
|
102
|
-
// #endif
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
onUnmounted(() => {
|
|
107
|
-
// #ifdef APP-NVUE
|
|
108
|
-
clearInterval(timer)
|
|
109
|
-
// #endif
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
// 根据长度,循环输入框的个数,因为头条小程序数值不能用于v-for
|
|
113
|
-
const codeLength = computed(() => {
|
|
114
|
-
return new Array(Number(props.maxlength))
|
|
115
|
-
})
|
|
116
|
-
// 循环item的样式
|
|
117
|
-
const itemStyle = computed(() => {
|
|
118
|
-
return (index: number) => {
|
|
119
|
-
const style: CSSProperties = {
|
|
120
|
-
width: boxSize,
|
|
121
|
-
height: boxSize
|
|
122
|
-
}
|
|
123
|
-
if (props.borderColor) {
|
|
124
|
-
style['--hy-border-color'] = props.borderColor
|
|
125
|
-
}
|
|
126
|
-
// 盒子模式下,需要额外进行处理
|
|
127
|
-
if (props.mode === 'box' && props.border) {
|
|
128
|
-
// 设置盒子的边框,如果是细边框,则设置为1px宽度
|
|
129
|
-
style.borderWidth = borderWidth.value
|
|
130
|
-
style.borderStyle = 'solid'
|
|
131
|
-
style.borderColor = props.borderColor
|
|
132
|
-
// 如果盒子间距为0的话
|
|
133
|
-
if (getPx(props.space) === 0) {
|
|
134
|
-
// 给第一和最后一个盒子设置圆角
|
|
135
|
-
if (index === 0) {
|
|
136
|
-
style.borderTopLeftRadius = '6px'
|
|
137
|
-
style.borderBottomLeftRadius = '6px'
|
|
138
|
-
}
|
|
139
|
-
if (index === codeLength.value.length - 1) {
|
|
140
|
-
style.borderTopRightRadius = '6px'
|
|
141
|
-
style.borderBottomRightRadius = '6px'
|
|
142
|
-
}
|
|
143
|
-
// 最后一个盒子的右边框需要保留
|
|
144
|
-
if (index !== codeLength.value.length - 1) {
|
|
145
|
-
style.borderRight = 'none'
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
if (index !== codeLength.value.length - 1) {
|
|
150
|
-
// 设置验证码字符之间的距离,通过margin-right设置,最后一个字符,无需右边框
|
|
151
|
-
style.marginRight = addUnit(props.space)
|
|
152
|
-
} else {
|
|
153
|
-
// 最后一个盒子的有边框需要保留
|
|
154
|
-
style.marginRight = 0
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return style
|
|
158
|
-
}
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
const itemClass = computed(() => {
|
|
162
|
-
return (index: number) => {
|
|
163
|
-
return [
|
|
164
|
-
'hy-code-input--item',
|
|
165
|
-
props.border ? `hy-code-input--item__${props.mode}` : 'hy-code-input--item__no',
|
|
166
|
-
current.value > index &&
|
|
167
|
-
getPx(props.space) != 0 &&
|
|
168
|
-
props.border &&
|
|
169
|
-
`hy-code-input--item__${props.mode}__border`,
|
|
170
|
-
isFocus.value &&
|
|
171
|
-
current.value === index &&
|
|
172
|
-
getPx(props.space) != 0 &&
|
|
173
|
-
(props.border
|
|
174
|
-
? `hy-code-input--item__${props.mode}__active`
|
|
175
|
-
: 'hy-code-input--item__no--active')
|
|
176
|
-
]
|
|
177
|
-
}
|
|
178
|
-
})
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* @description 将输入的值,转为数组,给item历遍时,根据当前的索引显示数组的元素
|
|
182
|
-
*/
|
|
183
|
-
const codeArray = computed(() => {
|
|
184
|
-
return String(inputValue.value).split('')
|
|
185
|
-
})
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* @description 监听输入框的值发生变化
|
|
189
|
-
* */
|
|
190
|
-
const inputHandler = (e: InputOnInputEvent) => {
|
|
191
|
-
const value = e.detail.value
|
|
192
|
-
inputValue.value = value
|
|
193
|
-
// 是否允许输入“.”符号
|
|
194
|
-
if (props.disabledDot) {
|
|
195
|
-
nextTick(() => {
|
|
196
|
-
inputValue.value = value.replace('.', '')
|
|
197
|
-
})
|
|
198
|
-
}
|
|
199
|
-
// 未达到maxlength之前,发送change事件,达到后发送finish事件
|
|
200
|
-
emit('change', value)
|
|
201
|
-
// 修改通过v-model双向绑定的值
|
|
202
|
-
emit('update:modelValue', value)
|
|
203
|
-
// 达到用户指定输入长度时,发出完成事件
|
|
204
|
-
if (String(value).length >= Number(props.maxlength)) {
|
|
205
|
-
emit('finish', value)
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
</script>
|
|
209
|
-
|
|
210
|
-
<style scoped lang="scss">
|
|
211
|
-
@import './index.scss';
|
|
212
|
-
@import '../../libs/css/mixin';
|
|
213
|
-
@import '../../libs/css/theme';
|
|
214
|
-
@include b(code-input) {
|
|
215
|
-
@include m(item) {
|
|
216
|
-
&__box {
|
|
217
|
-
&__active {
|
|
218
|
-
width: v-bind(boxSize);
|
|
219
|
-
height: v-bind(boxSize);
|
|
220
|
-
border-width: v-bind(borderWidth);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
&__line {
|
|
224
|
-
&::after {
|
|
225
|
-
height: v-bind(lineHeight);
|
|
226
|
-
background-color: $hy-border-color;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="['hy-code-input', customClass]">
|
|
3
|
+
<view
|
|
4
|
+
:class="itemClass(index)"
|
|
5
|
+
:style="[itemStyle(index)]"
|
|
6
|
+
v-for="(item, index) in codeLength"
|
|
7
|
+
:key="index"
|
|
8
|
+
>
|
|
9
|
+
<view
|
|
10
|
+
class="hy-code-input--item__dot"
|
|
11
|
+
v-if="dot && current > index"
|
|
12
|
+
:style="{ color: color }"
|
|
13
|
+
></view>
|
|
14
|
+
<text
|
|
15
|
+
v-else
|
|
16
|
+
class="hy-code-input--item__text"
|
|
17
|
+
:style="{
|
|
18
|
+
fontSize: addUnit(fontSize),
|
|
19
|
+
fontWeight: bold ? 'bold' : 'normal',
|
|
20
|
+
color: color
|
|
21
|
+
}"
|
|
22
|
+
>
|
|
23
|
+
{{ codeArray[index] }}
|
|
24
|
+
</text>
|
|
25
|
+
</view>
|
|
26
|
+
<input
|
|
27
|
+
:disabled="disabledKeyboard"
|
|
28
|
+
type="number"
|
|
29
|
+
:focus="focus"
|
|
30
|
+
:value="inputValue"
|
|
31
|
+
:maxlength="maxlength"
|
|
32
|
+
:adjustPosition="adjustPosition"
|
|
33
|
+
class="hy-code-input__input"
|
|
34
|
+
@input="inputHandler"
|
|
35
|
+
:style="{
|
|
36
|
+
height: boxSize
|
|
37
|
+
}"
|
|
38
|
+
@focus="isFocus = true"
|
|
39
|
+
@blur="isFocus = false"
|
|
40
|
+
/>
|
|
41
|
+
</view>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script lang="ts">
|
|
45
|
+
export default {
|
|
46
|
+
name: 'hy-code-input',
|
|
47
|
+
options: {
|
|
48
|
+
addGlobalClass: true,
|
|
49
|
+
virtualHost: true,
|
|
50
|
+
styleIsolation: 'shared'
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<script setup lang="ts">
|
|
56
|
+
import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
|
|
57
|
+
import type { CSSProperties } from 'vue'
|
|
58
|
+
import type { ICodeInputEmits } from './typing'
|
|
59
|
+
import { addUnit, getPx } from '../../libs'
|
|
60
|
+
import type { InputOnInputEvent } from '@uni-helper/uni-types'
|
|
61
|
+
import codeInputProps from './props'
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 一般用于验证用户短信验证码的场景,也可以结合华玥的键盘组件使用
|
|
65
|
+
* @displayName hy-code-input
|
|
66
|
+
*/
|
|
67
|
+
defineOptions({})
|
|
68
|
+
|
|
69
|
+
const props = defineProps(codeInputProps)
|
|
70
|
+
const emit = defineEmits<ICodeInputEmits>()
|
|
71
|
+
|
|
72
|
+
const current = ref(0)
|
|
73
|
+
const inputValue = ref('')
|
|
74
|
+
const isFocus = ref(props.focus)
|
|
75
|
+
let timer: ReturnType<typeof setInterval>
|
|
76
|
+
const opacity = ref(1)
|
|
77
|
+
const borderWidth = computed(() => (props.hairline ? '0.5px' : '2px'))
|
|
78
|
+
const lineHeight = computed(() => (props.hairline ? '2px' : '4px'))
|
|
79
|
+
const boxSize = addUnit(props.size)
|
|
80
|
+
|
|
81
|
+
watch(
|
|
82
|
+
() => props.modelValue,
|
|
83
|
+
(newValue: string | number) => {
|
|
84
|
+
inputValue.value = String(newValue).substring(0, props.maxlength)
|
|
85
|
+
current.value = newValue.toString().length
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
{ immediate: true }
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
watch(
|
|
92
|
+
() => isFocus.value,
|
|
93
|
+
(newValue) => {
|
|
94
|
+
// #ifdef APP-NVUE
|
|
95
|
+
if (newValue) {
|
|
96
|
+
timer = setInterval(() => {
|
|
97
|
+
opacity.value = Math.abs(opacity.value - 1)
|
|
98
|
+
}, 600)
|
|
99
|
+
} else {
|
|
100
|
+
clearInterval(timer)
|
|
101
|
+
}
|
|
102
|
+
// #endif
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
onUnmounted(() => {
|
|
107
|
+
// #ifdef APP-NVUE
|
|
108
|
+
clearInterval(timer)
|
|
109
|
+
// #endif
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
// 根据长度,循环输入框的个数,因为头条小程序数值不能用于v-for
|
|
113
|
+
const codeLength = computed(() => {
|
|
114
|
+
return new Array(Number(props.maxlength))
|
|
115
|
+
})
|
|
116
|
+
// 循环item的样式
|
|
117
|
+
const itemStyle = computed(() => {
|
|
118
|
+
return (index: number) => {
|
|
119
|
+
const style: CSSProperties = {
|
|
120
|
+
width: boxSize,
|
|
121
|
+
height: boxSize
|
|
122
|
+
}
|
|
123
|
+
if (props.borderColor) {
|
|
124
|
+
style['--hy-border-color'] = props.borderColor
|
|
125
|
+
}
|
|
126
|
+
// 盒子模式下,需要额外进行处理
|
|
127
|
+
if (props.mode === 'box' && props.border) {
|
|
128
|
+
// 设置盒子的边框,如果是细边框,则设置为1px宽度
|
|
129
|
+
style.borderWidth = borderWidth.value
|
|
130
|
+
style.borderStyle = 'solid'
|
|
131
|
+
style.borderColor = props.borderColor
|
|
132
|
+
// 如果盒子间距为0的话
|
|
133
|
+
if (getPx(props.space) === 0) {
|
|
134
|
+
// 给第一和最后一个盒子设置圆角
|
|
135
|
+
if (index === 0) {
|
|
136
|
+
style.borderTopLeftRadius = '6px'
|
|
137
|
+
style.borderBottomLeftRadius = '6px'
|
|
138
|
+
}
|
|
139
|
+
if (index === codeLength.value.length - 1) {
|
|
140
|
+
style.borderTopRightRadius = '6px'
|
|
141
|
+
style.borderBottomRightRadius = '6px'
|
|
142
|
+
}
|
|
143
|
+
// 最后一个盒子的右边框需要保留
|
|
144
|
+
if (index !== codeLength.value.length - 1) {
|
|
145
|
+
style.borderRight = 'none'
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (index !== codeLength.value.length - 1) {
|
|
150
|
+
// 设置验证码字符之间的距离,通过margin-right设置,最后一个字符,无需右边框
|
|
151
|
+
style.marginRight = addUnit(props.space)
|
|
152
|
+
} else {
|
|
153
|
+
// 最后一个盒子的有边框需要保留
|
|
154
|
+
style.marginRight = 0
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return style
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
const itemClass = computed(() => {
|
|
162
|
+
return (index: number) => {
|
|
163
|
+
return [
|
|
164
|
+
'hy-code-input--item',
|
|
165
|
+
props.border ? `hy-code-input--item__${props.mode}` : 'hy-code-input--item__no',
|
|
166
|
+
current.value > index &&
|
|
167
|
+
getPx(props.space) != 0 &&
|
|
168
|
+
props.border &&
|
|
169
|
+
`hy-code-input--item__${props.mode}__border`,
|
|
170
|
+
isFocus.value &&
|
|
171
|
+
current.value === index &&
|
|
172
|
+
getPx(props.space) != 0 &&
|
|
173
|
+
(props.border
|
|
174
|
+
? `hy-code-input--item__${props.mode}__active`
|
|
175
|
+
: 'hy-code-input--item__no--active')
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @description 将输入的值,转为数组,给item历遍时,根据当前的索引显示数组的元素
|
|
182
|
+
*/
|
|
183
|
+
const codeArray = computed(() => {
|
|
184
|
+
return String(inputValue.value).split('')
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @description 监听输入框的值发生变化
|
|
189
|
+
* */
|
|
190
|
+
const inputHandler = (e: InputOnInputEvent) => {
|
|
191
|
+
const value = e.detail.value
|
|
192
|
+
inputValue.value = value
|
|
193
|
+
// 是否允许输入“.”符号
|
|
194
|
+
if (props.disabledDot) {
|
|
195
|
+
nextTick(() => {
|
|
196
|
+
inputValue.value = value.replace('.', '')
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
// 未达到maxlength之前,发送change事件,达到后发送finish事件
|
|
200
|
+
emit('change', value)
|
|
201
|
+
// 修改通过v-model双向绑定的值
|
|
202
|
+
emit('update:modelValue', value)
|
|
203
|
+
// 达到用户指定输入长度时,发出完成事件
|
|
204
|
+
if (String(value).length >= Number(props.maxlength)) {
|
|
205
|
+
emit('finish', value)
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
</script>
|
|
209
|
+
|
|
210
|
+
<style scoped lang="scss">
|
|
211
|
+
@import './index.scss';
|
|
212
|
+
@import '../../libs/css/mixin';
|
|
213
|
+
@import '../../libs/css/theme';
|
|
214
|
+
@include b(code-input) {
|
|
215
|
+
@include m(item) {
|
|
216
|
+
&__box {
|
|
217
|
+
&__active {
|
|
218
|
+
width: v-bind(boxSize);
|
|
219
|
+
height: v-bind(boxSize);
|
|
220
|
+
border-width: v-bind(borderWidth);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
&__line {
|
|
224
|
+
&::after {
|
|
225
|
+
height: v-bind(lineHeight);
|
|
226
|
+
background-color: $hy-border-color;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
</style>
|
|
@@ -1,88 +1,90 @@
|
|
|
1
|
-
import type IProps from './typing'
|
|
2
|
-
import type { CSSProperties, PropType } from 'vue'
|
|
3
|
-
|
|
4
|
-
const codeInputProps = {
|
|
5
|
-
/** 获取值 */
|
|
6
|
-
modelValue: {
|
|
7
|
-
type: [String, Number],
|
|
8
|
-
required: true
|
|
9
|
-
},
|
|
10
|
-
/** 键盘弹起时,是否自动上推页面 */
|
|
11
|
-
adjustPosition: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: true
|
|
14
|
-
},
|
|
15
|
-
/** 最大输入长度 */
|
|
16
|
-
maxlength: {
|
|
17
|
-
type: Number,
|
|
18
|
-
default: 6
|
|
19
|
-
},
|
|
20
|
-
/** 显示border */
|
|
21
|
-
border: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: true
|
|
24
|
-
},
|
|
25
|
-
/** 是否用圆点填充 */
|
|
26
|
-
dot: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: false
|
|
29
|
-
},
|
|
30
|
-
/**
|
|
31
|
-
* 示模式,box-盒子模式,line-底部横线模式
|
|
32
|
-
* @values box,line
|
|
33
|
-
* */
|
|
34
|
-
mode: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: 'box'
|
|
37
|
-
},
|
|
38
|
-
/** 是否细边框 */
|
|
39
|
-
hairline: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: false
|
|
42
|
-
},
|
|
43
|
-
/** 字符间的距离 */
|
|
44
|
-
space: {
|
|
45
|
-
type: Number,
|
|
46
|
-
default: 10
|
|
47
|
-
},
|
|
48
|
-
/** 是否自动获取焦点 */
|
|
49
|
-
focus: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: false
|
|
52
|
-
},
|
|
53
|
-
/** 字体是否加粗 */
|
|
54
|
-
bold: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false
|
|
57
|
-
},
|
|
58
|
-
/** 字体颜色 */
|
|
59
|
-
color: String,
|
|
60
|
-
/** 字体大小,单位px */
|
|
61
|
-
fontSize: {
|
|
62
|
-
type: [String, Number],
|
|
63
|
-
default: 18
|
|
64
|
-
},
|
|
65
|
-
/** 输入框的大小,宽等于高 */
|
|
66
|
-
size: {
|
|
67
|
-
type: [String, Number],
|
|
68
|
-
default: 35
|
|
69
|
-
},
|
|
70
|
-
/** 是否隐藏原生键盘,如果想用自定义键盘的话,需设置此参数为true */
|
|
71
|
-
disabledKeyboard: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: false
|
|
74
|
-
},
|
|
75
|
-
/** 边框和线条颜色 */
|
|
76
|
-
borderColor: String,
|
|
77
|
-
/** 是否禁止输入"."符号 */
|
|
78
|
-
disabledDot: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
default: true
|
|
81
|
-
},
|
|
82
|
-
/** 定义需要用到的外部样式 */
|
|
83
|
-
customStyle: {
|
|
84
|
-
type: Object as PropType<CSSProperties>
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
1
|
+
import type IProps from './typing'
|
|
2
|
+
import type { CSSProperties, PropType } from 'vue'
|
|
3
|
+
|
|
4
|
+
const codeInputProps = {
|
|
5
|
+
/** 获取值 */
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: [String, Number],
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
/** 键盘弹起时,是否自动上推页面 */
|
|
11
|
+
adjustPosition: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: true
|
|
14
|
+
},
|
|
15
|
+
/** 最大输入长度 */
|
|
16
|
+
maxlength: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 6
|
|
19
|
+
},
|
|
20
|
+
/** 显示border */
|
|
21
|
+
border: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
/** 是否用圆点填充 */
|
|
26
|
+
dot: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* 示模式,box-盒子模式,line-底部横线模式
|
|
32
|
+
* @values box,line
|
|
33
|
+
* */
|
|
34
|
+
mode: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 'box'
|
|
37
|
+
},
|
|
38
|
+
/** 是否细边框 */
|
|
39
|
+
hairline: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
/** 字符间的距离 */
|
|
44
|
+
space: {
|
|
45
|
+
type: Number,
|
|
46
|
+
default: 10
|
|
47
|
+
},
|
|
48
|
+
/** 是否自动获取焦点 */
|
|
49
|
+
focus: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
},
|
|
53
|
+
/** 字体是否加粗 */
|
|
54
|
+
bold: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
/** 字体颜色 */
|
|
59
|
+
color: String,
|
|
60
|
+
/** 字体大小,单位px */
|
|
61
|
+
fontSize: {
|
|
62
|
+
type: [String, Number],
|
|
63
|
+
default: 18
|
|
64
|
+
},
|
|
65
|
+
/** 输入框的大小,宽等于高 */
|
|
66
|
+
size: {
|
|
67
|
+
type: [String, Number],
|
|
68
|
+
default: 35
|
|
69
|
+
},
|
|
70
|
+
/** 是否隐藏原生键盘,如果想用自定义键盘的话,需设置此参数为true */
|
|
71
|
+
disabledKeyboard: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false
|
|
74
|
+
},
|
|
75
|
+
/** 边框和线条颜色 */
|
|
76
|
+
borderColor: String,
|
|
77
|
+
/** 是否禁止输入"."符号 */
|
|
78
|
+
disabledDot: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: true
|
|
81
|
+
},
|
|
82
|
+
/** 定义需要用到的外部样式 */
|
|
83
|
+
customStyle: {
|
|
84
|
+
type: Object as PropType<CSSProperties>
|
|
85
|
+
},
|
|
86
|
+
/** 自定义外部类名 */
|
|
87
|
+
customClass: String
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export default codeInputProps
|
|
@@ -5,14 +5,11 @@
|
|
|
5
5
|
@include b(config-provider) {
|
|
6
6
|
box-sizing: border-box;
|
|
7
7
|
width: 100%;
|
|
8
|
-
|
|
9
|
-
height: calc(100vh -
|
|
10
|
-
|
|
11
|
-
/* #ifndef H5 */
|
|
12
|
-
height: 100vh;
|
|
13
|
-
/* #endif */
|
|
8
|
+
height: calc(100vh - var(--window-top));
|
|
9
|
+
height: calc(100vh - var(--window-top) - constant(safe-area-inset-bottom));
|
|
10
|
+
height: calc(100vh - var(--window-top) - env(safe-area-inset-bottom));
|
|
14
11
|
overflow-y: auto;
|
|
15
|
-
overflow-x: hidden;
|
|
12
|
+
//overflow-x: hidden;
|
|
16
13
|
background-color: $hy-background;
|
|
17
14
|
color: $hy-text-color;
|
|
18
15
|
}
|