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
83a34603
Commit
83a34603
authored
Mar 04, 2021
by
Vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(form): fix the problem of form props monitoring close #322
parent
ce93e46f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+7
-0
useForm.ts
src/components/Form/src/hooks/useForm.ts
+11
-5
No files found.
CHANGELOG.zh_CN.md
View file @
83a34603
## Wip
### 🐛 Bug Fixes
-
修复
`Description`
已知问题
-
修复
`BasicForm`
已知问题
## 2.0.2 (2021-03-04)
### ✨ Refactor
...
...
src/components/Form/src/hooks/useForm.ts
View file @
83a34603
import
{
ref
,
onUnmounted
,
unref
,
nextTick
,
watch
Effect
}
from
'
vue
'
;
import
{
ref
,
onUnmounted
,
unref
,
nextTick
,
watch
}
from
'
vue
'
;
import
{
isInSetup
}
from
'
/@/utils/helper/vueHelper
'
;
import
{
isProdMode
}
from
'
/@/utils/env
'
;
...
...
@@ -39,12 +39,18 @@ export function useForm(props?: Props): UseFormReturnType {
if
(
unref
(
loadedRef
)
&&
isProdMode
()
&&
instance
===
unref
(
formRef
))
return
;
formRef
.
value
=
instance
;
loadedRef
.
value
=
true
;
watchEffect
(()
=>
{
watch
(
()
=>
props
,
()
=>
{
props
&&
instance
.
setProps
(
getDynamicProps
(
props
));
});
},
{
immediate
:
true
,
deep
:
true
,
}
);
}
const
methods
:
FormActionType
=
{
...
...
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