vue3-directive-number
v1.0.4
Published
Vue3 number directive supports IME for inputs including other Ui frameworks's input Element
Downloads
35
Maintainers
Readme
vue3-directive-number
Vue3 number directive supports IME for inputs including other Ui frameworks's input Element
Features
Force to enter only numbers
Installation
npm install vue3-directive-number
yarn add vue3-directive-number
Usage
main.ts
import { createApp } from "vue";
import App from "./App.vue";
import VueNumber from "vue3-directive-number";
createApp(App).use(VueNumber).mount("#app");
<template>
<input v-number.minus.point.money="option" />
</template>
<script setup lang="ts">
const option = {
min: 0,
max: 10000,
};
</script>
Modifiers
minus
Required: false
Allow minus
point
Required: false
Allow decimal point
money
Required: false
Automatically add comma separators
Options
min?: number; // Default -10000000000000000000
max?: number; // Default 10000000000000000000
allowStartZero?: boolean; // Default false
License
MIT License