An open API service indexing awesome lists of open source software.

https://github.com/x-extends/vxe-table-plugin-validator

基于 vxe-table 的表格插件,提供一些常用的校验
https://github.com/x-extends/vxe-table-plugin-validator

Last synced: 7 months ago
JSON representation

基于 vxe-table 的表格插件,提供一些常用的校验

Awesome Lists containing this project

README

          

# vxe-table-plugin-validator

[![gitee star](https://gitee.com/x-extends/vxe-table-plugin-validator/badge/star.svg?theme=dark)](https://gitee.com/x-extends/vxe-table-plugin-validator/stargazers)
[![npm version](https://img.shields.io/npm/v/vxe-table-plugin-validator.svg?style=flat-square)](https://www.npmjs.com/package/vxe-table-plugin-validator)
[![npm downloads](https://img.shields.io/npm/dm/vxe-table-plugin-validator.svg?style=flat-square)](http://npm-stat.com/charts.html?package=vxe-table-plugin-validator)
[![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)

基于 [vxe-table](https://github.com/x-extends/vxe-table) 的表格插件,提供一些常用的校验

## Compatibility

依赖 vxe-table v4 版本

## Installing

```shell
npm install vxe-table@next vxe-table-plugin-validator@next
```

```javascript
// ...
import VXETable from 'vxe-table'
import VXETablePluginValidator from 'vxe-table-plugin-validator'
// ...

VXETable.use(VXETablePluginValidator)
```

## API

### Validator codes

| code 编码 | describe 描述 | params 参数 |
|------|------|------|
| MOBILE_NUMBER | 手机号13位 | — |
| EMAIL_ADDRESS | 邮箱地址 | — |
| IDENTITY_CARD | 身份证号码 | — |
| IP_ADDRESS | IP地址 | — |
| URL | URL地址 | — |
| PLATE_NUMBER | 车牌号 | — |

## Demo

```html




```

```javascript
export default {
data () {
return {
tableData: [
{ id: 100, name: 'test1', mobile: '', email: '' },
{ id: 101, name: 'test2', mobile: '', email: '' },
{ id: 102, name: 'test3', mobile: '', email: '' }
],
editRules: {
mobile: [
{ required: true, validator: 'MOBILE_NUMBER' }
],
email: [
{ required: true, validator: 'EMAIL_ADDRESS' }
]
}
}
}
}
```

## License

MIT License, 2019-present, Xu Liangzhan