Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-autonumeric-directive

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-autonumeric-directive

Vue directive plugin to assure number to be number

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20
increased by900%
Maintainers
1
Weekly downloads
 
Created
Source

vue-autonumeric-directive

npm Version

Node.js

GitHub License

Build Status

example(待添加)

Introduction

vue-autonumeric-directive是一个基于autoNumeric的Vue插件,使用简单的指令方式,对需要的元素添加格式化功能。

Use Guide

Installation

# with `yarn` :
yarn add vue-autonumeric-directive

# or with `npm` :
npm install vue-autonumeric-directive --save

How to use?

按照Vue插件方式注册插件。

在浏览器中插件的全局名称为VueNumberFormat

<input name="input1" id="input1" v-model="input1" v-number="config1">
new Vue({
  el: '#demo',

  data: {
    input1: '123.00',
    config1: { bind: 'input1' },
    input2: 32,
  }
})

On which elements can it be used

On which elements can it be used

<input>

只支持下列input类型

  • text,
  • tel,
  • hidden, or
  • no type specified at all

支持contenteditable元素

支持其他元素的一次性格式化

支持Vue组件

支持element-ui Input组件

Options

declare type InputOptions = {
  unsafeSet: boolean;

  bind: string;
  min: string,
  max: string,
  presion: string,  // 精确到小数点后几位

  local: string,    // autoNumeric本地化配置,
  predifined: string, // autoNumeric预定义配置

  numricOptions: AutoNumericOptions;
};

local: 参考autoNumeric language options predifined: 参考autoNumeric predifined options

numricOptions选项

参考numberic numricOptions autoNumeric options

Features

  1. 保留原事件响应
  2. 把AutoNumeric挂在了插件下
  3. 把AutoNumeric的实例挂在了对应的element下,方便调用它的方法

Keywords

FAQs

Package last updated on 12 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc