v-input
Function Introduction
Input formatting
Example
Usage
typescript
<template>
<div>
<label>Limited to numbers: </label>
<input type="text" v-input:number />
</div>
<div>
<label>Limited to decimal points:</label>
<input type="text" v-input:decimal="3" />
</div>
<div>
<label>Custom restrictions:</label>
<input type="text" v-input:customize="/[^\d]/"/>
</div>
</template>
Rule
v-input:type
="restrict
"
v-input type
rule:
parameters | default (restrict) | description |
---|---|---|
number | - | is limited to the number |
decimal | 10 | The value is limited to decimals and restrict the number that indicates the next few decimals |
customize | - | Customize the regular expression, restrict enter the regular expression |