Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
1. validator新增第三个参数,触发类型,默认有:change blur none
2. validate回调方法新增第三个参数isAbort,并发异步校验默认会取消前一次校验。可通过该参数进行判断。
3. 修复onChange不触发问题
  • Loading branch information
bplok20010 committed Nov 3, 2019
1 parent b8f4088 commit 935e311
Show file tree
Hide file tree
Showing 39 changed files with 2,580 additions and 1,249 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
### Types

```ts
type ValidateTriggerType = "change" | "blur";
type ValidateTriggerType = "change" | "blur" | "none";

type Validator = (
value: any,
Expand Down Expand Up @@ -213,13 +213,16 @@ export default function NativeInput(props) {
isValidating(): boolean;
validateField(
name: string,
callback: (errors: null | InvalidError[], formValue: {}) => void
callback: (errors: null | InvalidError[], formValue: {},isAbort: true | undefined) => void,
triggerType: ValidateTriggerType
): boolean;
validate(
callback: (errors: null | InvalidError[], formValue: {}) => void
callback: (errors: null | InvalidError[], formValue: {},isAbort: true | undefined) => void,
triggerType: ValidateTriggerType
): boolean;
validateAndScroll(
callback: (errors: null | InvalidError[], formValue: {}) => void
callback: (errors: null | InvalidError[], formValue: {},isAbort: true | undefined) => void,
triggerType: ValidateTriggerType
): boolean;
}
```
Expand All @@ -237,7 +240,8 @@ export default function NativeInput(props) {
setError(message: any): void;
isValidating(): boolean;
validate(
callback: (errors: null | InvalidError[], formValue: {}) => void
callback: (errors: null | InvalidError[], formValue: {},isAbort: true | undefined) => void,
triggerType: ValidateTriggerType
): boolean;
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html style="width:100%;height:100%;overflow:auto"><head><meta charset="utf-8"><title>Layout</title><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"><style>.demo{width:1100px;height:500px;margin:50px auto;background:#fff;font-size:12px;overflow:auto}.rw-layout-content{height:200px}.rw-layout.rw-layout-has-sider{text-align:center;background:#3ba0e9}.rw-layout-sider{width:200px;text-align:center;background:#3ba0e9;color:#fff}.rw-layout-footer,.rw-layout-header{background:#7dbcea;color:#fff;height:64px;line-height:64px;text-align:center}.rw-layout-content{background:rgba(16,142,233,1);color:#fff;text-align:center}</style><link href="static/css/2.b4a4d82b.chunk.css" rel="stylesheet"><link href="static/css/index.8f87eb2c.chunk.css" rel="stylesheet"></head><body style="background:#f5f5f5"><div class="demo" id="demo"></div><script src="static/js/runtime~index.f795885b.js"></script><script src="static/js/2.b4a4d82b.chunk.js"></script><script src="static/js/index.8f87eb2c.chunk.js"></script></body></html>
<!doctype html><html style="width:100%;height:100%;overflow:auto"><head><meta charset="utf-8"><title>Layout</title><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1"><style>.demo{width:1100px;height:500px;margin:50px auto;background:#fff;font-size:12px;overflow:auto}.rw-layout-content{height:200px}.rw-layout.rw-layout-has-sider{text-align:center;background:#3ba0e9}.rw-layout-sider{width:200px;text-align:center;background:#3ba0e9;color:#fff}.rw-layout-footer,.rw-layout-header{background:#7dbcea;color:#fff;height:64px;line-height:64px;text-align:center}.rw-layout-content{background:rgba(16,142,233,1);color:#fff;text-align:center}</style><link href="static/css/2.71a0092d.chunk.css" rel="stylesheet"><link href="static/css/index.3626f3b8.chunk.css" rel="stylesheet"></head><body style="background:#f5f5f5"><div class="demo" id="demo"></div><script src="static/js/runtime~index.f795885b.js"></script><script src="static/js/2.71a0092d.chunk.js"></script><script src="static/js/index.3626f3b8.chunk.js"></script></body></html>
13 changes: 4 additions & 9 deletions docs/manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"index.css": "static/css/index.8f87eb2c.chunk.css",
"index.js": "static/js/index.8f87eb2c.chunk.js",
"index.js.map": "static/js/index.8f87eb2c.chunk.js.map",
"index.css": "static/css/index.3626f3b8.chunk.css",
"index.js": "static/js/index.3626f3b8.chunk.js",
"runtime~index.js": "static/js/runtime~index.f795885b.js",
"runtime~index.js.map": "static/js/runtime~index.f795885b.js.map",
"static/css/2.b4a4d82b.chunk.css": "static/css/2.b4a4d82b.chunk.css",
"static/js/2.b4a4d82b.chunk.js": "static/js/2.b4a4d82b.chunk.js",
"static/js/2.b4a4d82b.chunk.js.map": "static/js/2.b4a4d82b.chunk.js.map",
"static/css/2.71a0092d.chunk.css": "static/css/2.71a0092d.chunk.css",
"static/js/2.71a0092d.chunk.js": "static/js/2.71a0092d.chunk.js",
"index.html": "index.html",
"static/css/2.b4a4d82b.chunk.css.map": "static/css/2.b4a4d82b.chunk.css.map",
"static/css/index.8f87eb2c.chunk.css.map": "static/css/index.8f87eb2c.chunk.css.map",
"static/media/index.css": "static/media/ionicons.d535a25a.ttf"
}
2 changes: 2 additions & 0 deletions docs/static/css/2.71a0092d.chunk.css

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions docs/static/css/2.b4a4d82b.chunk.css

This file was deleted.

1 change: 0 additions & 1 deletion docs/static/css/2.b4a4d82b.chunk.css.map

This file was deleted.

1 change: 1 addition & 0 deletions docs/static/css/index.3626f3b8.chunk.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions docs/static/css/index.8f87eb2c.chunk.css

This file was deleted.

1 change: 0 additions & 1 deletion docs/static/css/index.8f87eb2c.chunk.css.map

This file was deleted.

1 change: 1 addition & 0 deletions docs/static/js/2.71a0092d.chunk.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/static/js/2.b4a4d82b.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/static/js/2.b4a4d82b.chunk.js.map

This file was deleted.

1 change: 1 addition & 0 deletions docs/static/js/index.3626f3b8.chunk.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/static/js/index.8f87eb2c.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/static/js/index.8f87eb2c.chunk.js.map

This file was deleted.

Loading

0 comments on commit 935e311

Please sign in to comment.