Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
e7e104df
Commit
e7e104df
authored
Dec 20, 2016
by
baiyaaaaa
Committed by
杨奕
Dec 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix form validate callback params
parent
7e612866
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
examples/docs/en-US/form.md
examples/docs/en-US/form.md
+4
-4
examples/docs/zh-CN/form.md
examples/docs/zh-CN/form.md
+5
-5
packages/form/src/form-item.vue
packages/form/src/form-item.vue
+1
-1
No files found.
examples/docs/en-US/form.md
View file @
e7e104df
...
@@ -809,10 +809,10 @@ Form component allows you to verify your data, helping you find and correct erro
...
@@ -809,10 +809,10 @@ Form component allows you to verify your data, helping you find and correct erro
### Form Methods
### Form Methods
| Method | Description |
| Method | Description |
params
| ---- | ---- |
| ---- | ---- |
----
| validate
(cb) | the method to validate the whole form |
| validate
| the method to validate the whole form | Function(callback: Function(boolean))
| validateField
(prop, cb) | the method to validate a certain form item |
| validateField
| the method to validate a certain form item | Function(prop: string, callback: Function(errorMessage: string))
| resetFields | reset all the fields and remove validation result |
| resetFields | reset all the fields and remove validation result |
### Form-Item Attributes
### Form-Item Attributes
...
...
examples/docs/zh-CN/form.md
View file @
e7e104df
...
@@ -799,11 +799,11 @@
...
@@ -799,11 +799,11 @@
### Form Methods
### Form Methods
| 方法名 | 说明 |
| 方法名 | 说明 |
参数
|---------- |-------------- |
|---------- |-------------- |
--------------
| validate
(cb) | 对整个表单进行校验的方法 |
| validate
| 对整个表单进行校验的方法 | Function(callback: Function(boolean))
| validateField
(prop, cb) | 对部分表单字段进行校验的方法 |
| validateField
| 对部分表单字段进行校验的方法 | Function(prop: string, callback: Function(errorMessage: string))
| resetFields | 对整个表单进行重置,将所有字段值重置为空并移除校验结果 |
| resetFields | 对整个表单进行重置,将所有字段值重置为空并移除校验结果 |
-
### Form-Item Attributes
### Form-Item Attributes
...
...
packages/form/src/form-item.vue
View file @
e7e104df
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
this
.
validateState
=
!
errors
?
'
success
'
:
'
error
'
;
this
.
validateState
=
!
errors
?
'
success
'
:
'
error
'
;
this
.
validateMessage
=
errors
?
errors
[
0
].
message
:
''
;
this
.
validateMessage
=
errors
?
errors
[
0
].
message
:
''
;
callback
(
errors
);
callback
(
this
.
validateMessage
);
});
});
},
},
resetField
()
{
resetField
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment