https://github.com/jsoon/typeinput
用于控制输入数据类型.
https://github.com/jsoon/typeinput
Last synced: 5 months ago
JSON representation
用于控制输入数据类型.
- Host: GitHub
- URL: https://github.com/jsoon/typeinput
- Owner: JSoon
- License: mit
- Created: 2020-06-02T08:44:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T18:45:37.000Z (over 3 years ago)
- Last Synced: 2024-12-30T00:48:27.789Z (over 1 year ago)
- Language: JavaScript
- Size: 380 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
输入数据类型控制工具模块
用于表单输入控件中, 对输入文本进行类型限制, 目前实现的类型有:
- 文本输入
- 整数输入
- 小数输入
## 单元测试
1. `npm install`
2. `npm run test`
3. 访问 `http://localhost:8080/test.html`
## 使用方法
1. 安装模块
```
npm i @financial-freedom/typeinput
```
2. 导入模块
```js
// 整体导入
import * as typeinput from '@financial-freedom/typeinput';
import {
text,
integer,
decimal,
} from '@financial-freedom/typeinput';
// 单独导入
import text from '@financial-freedom/typeinput/src/types/text';
import integer from '@financial-freedom/typeinput/src/types/integer';
import decimal from '@financial-freedom/typeinput/src/types/decimal';
```
## 文档
请查看源码 JSDoc 注释.
## 浏览器兼容性
```
defaults
> 5% in CN
last 2 versions
ie >= 10
```