Skip to content

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:

parametersdefault (restrict)description
number-is limited to the number
decimal10The 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

Released under the MIT License.