vue3-directive-number
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

Package Sidebar

Install

npm i vue3-directive-number

Weekly Downloads

5

Version

1.0.4

License

MIT

Unpacked Size

30.9 kB

Total Files

9

Last publish

Collaborators

  • jongmin4943