Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
d09406e3
Commit
d09406e3
authored
Oct 25, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add the parameter submitOnReset to the form (#54)
parent
74d47424
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
BasicForm.vue
src/components/Form/src/BasicForm.vue
+2
-1
props.ts
src/components/Form/src/props.ts
+4
-0
form.ts
src/components/Form/src/types/form.ts
+2
-1
BasicTable.vue
src/components/Table/src/BasicTable.vue
+1
-0
No files found.
src/components/Form/src/BasicForm.vue
View file @
d09406e3
...
...
@@ -266,7 +266,7 @@
}
async
function
resetFields
():
Promise
<
any
>
{
const
{
resetFunc
}
=
unref
(
getProps
);
const
{
resetFunc
,
submitOnReset
}
=
unref
(
getProps
);
resetFunc
&&
isFunction
(
resetFunc
)
&&
(
await
resetFunc
());
const
formEl
=
unref
(
formElRef
);
if
(
!
formEl
)
return
;
...
...
@@ -276,6 +276,7 @@
// const values = formEl.resetFields();
emit
(
'
reset
'
,
toRaw
(
formModel
));
// return values;
submitOnReset
&&
handleSubmit
();
}
/**
...
...
src/components/Form/src/props.ts
View file @
d09406e3
...
...
@@ -30,6 +30,10 @@ export const basicProps = {
type
:
Boolean
,
default
:
true
,
},
submitOnReset
:
{
type
:
Boolean
,
default
:
false
,
},
size
:
{
type
:
String
as
PropType
<
'
default
'
|
'
small
'
|
'
large
'
>
,
default
:
'
default
'
,
...
...
src/components/Form/src/types/form.ts
View file @
d09406e3
...
...
@@ -30,7 +30,8 @@ export type UseFormReturnType = [RegisterFn, FormActionType];
export
interface
FormProps
{
// 整个表单所有项宽度
labelWidth
?:
number
|
string
;
// 重置时提交
submitOnReset
?:
boolean
;
// 整个表单通用Col配置
labelCol
?:
Partial
<
ColEx
>
;
// 整个表单通用Col配置
...
...
src/components/Table/src/BasicTable.vue
View file @
d09406e3
...
...
@@ -9,6 +9,7 @@
<BasicForm
v-bind=
"getFormProps"
v-if=
"getBindValues.useSearchForm"
:submitOnReset=
"true"
:submitButtonOptions=
"
{ loading }"
@register="registerForm"
@submit="handleSearchInfoChange"
...
...
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