✨(input): 新增 max 与 min 属性, 用于控制 type=number 下的最大值与最小值
This commit is contained in:
parent
9bbb99bc74
commit
bbf0409262
@ -27,6 +27,8 @@ export interface InputProps {
|
||||
password?: boolean;
|
||||
size?: InputSize;
|
||||
maxlength?: number;
|
||||
max?: number;
|
||||
min?: number;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<InputProps>(), {
|
||||
@ -159,6 +161,8 @@ const showPassword = () => {
|
||||
:autofocus="autofocus"
|
||||
:autocomplete="autocomplete"
|
||||
:maxlength="maxlength"
|
||||
:max="max"
|
||||
:min="min"
|
||||
:readonly="readonly"
|
||||
@input="onInput"
|
||||
@change="onChange"
|
||||
|
@ -135,11 +135,13 @@ const isNumber = function (num: any) {
|
||||
<div class="layui-input-number-input">
|
||||
<lay-input
|
||||
v-model="num"
|
||||
:readonly="disabledInput || disabled"
|
||||
type="number"
|
||||
:readonly="disabledInput || disabled"
|
||||
:disabled="disabledInput || disabled"
|
||||
:max="max"
|
||||
:min="min"
|
||||
:name="name"
|
||||
@change="inputChange"
|
||||
:disabled="disabledInput || disabled"
|
||||
/>
|
||||
</div>
|
||||
<lay-button
|
||||
|
Loading…
Reference in New Issue
Block a user