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