Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 02c4014a
authored
Sep 14, 2024
by
Vben
Committed by
GitHub
Sep 14, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: when the form is opened repeatedly, the state is unexpectedly destroyed (#4406)
1 parent
c3d0102c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
packages/@core/ui-kit/form-ui/src/form-api.ts
playground/src/views/examples/modal/form-model-demo.vue
packages/@core/ui-kit/form-ui/src/form-api.ts
View file @
02c4014
...
...
@@ -177,7 +177,7 @@ export class FormApi {
}
unmounted
()
{
this
.
state
=
null
;
//
this.state = null;
this
.
isMounted
=
false
;
this
.
stateHandler
.
reset
();
}
...
...
playground/src/views/examples/modal/form-model-demo.vue
View file @
02c4014
<
script
lang=
"ts"
setup
>
import
{
useVbenModal
}
from
'@vben/common-ui'
;
import
{
message
}
from
'ant-design-vue'
;
import
{
useVbenForm
}
from
'#/adapter'
;
defineOptions
({
name
:
'FormModelDemo'
,
});
function
onSubmit
(
values
:
Record
<
string
,
any
>
)
{
message
.
info
(
JSON
.
stringify
(
values
));
// 只会执行一次
}
const
[
Form
,
formApi
]
=
useVbenForm
({
handleSubmit
:
onSubmit
,
schema
:
[
{
component
:
'Input'
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment