cy-number-input

1.0.1 • Public • Published

#前端公共组件

cy-number-input

##1. 介绍 传统的数字输入框功能有限,在实际项目中,需要给输入框增加更多功能,如备选列表、最大最小值限制、多个有效数值区间等。因此封装了一个directive,方便配置参数设置,此插件基于原生javascript开发,依赖angularJS实现双向绑定(version<angular2.0)。

##2.使用方法

2.1 安装组件

npm install cy-number-input

2.2 引入到项目中

<link href="/static/directives/number-input/number-input.css" rel="stylesheet">
<script src="/static/directives/number-input/number-input.js"></script>

###2.3 html中引入组件标签 <number-input model="data" default="-1" range="['-1:9999999']" step="1" not-blank="true"select-options="[1, 2, 3, 4, 5, 6, 7, 8]" >

2.4 对应的ts中:

##3. 组件参数说明

参数 参数说明
model 数据绑定项,等同于angularJs的ng-model
default 设置默认参数
range 设置取值范围(默认值:-1-9999999)
step 设置滚轮滚动的步长
not-blank 不能为空属性设置(默认值为true)
ng-disabled disabled状态设置(默认值:false)
select-options 配置可选参数列表

Readme

Keywords

none

Package Sidebar

Install

npm i cy-number-input

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

39.9 kB

Total Files

6

Last publish

Collaborators

  • jsoncm