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 的表格插件,提供一些常用的校验
- Host: GitHub
- URL: https://github.com/x-extends/vxe-table-plugin-validator
- Owner: x-extends
- License: mit
- Created: 2023-07-22T09:17:36.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T07:47:35.000Z (over 1 year ago)
- Last Synced: 2025-08-09T18:52:09.783Z (12 months ago)
- Language: TypeScript
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vxe-table-plugin-validator
[](https://gitee.com/x-extends/vxe-table-plugin-validator/stargazers)
[](https://www.npmjs.com/package/vxe-table-plugin-validator)
[](http://npm-stat.com/charts.html?package=vxe-table-plugin-validator)
[](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