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
43a45b7c
Commit
43a45b7c
authored
Mar 07, 2021
by
Vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(form): ensure that the Form component does not verify hidden form items
parent
e0dc5cf2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+2
-0
FormItem.tsx
src/components/Form/src/components/FormItem.tsx
+5
-1
useFormEvents.ts
src/components/Form/src/hooks/useFormEvents.ts
+1
-0
account.data.ts
src/views/demo/system/account/account.data.ts
+1
-1
No files found.
CHANGELOG.zh_CN.md
View file @
43a45b7c
...
...
@@ -4,6 +4,7 @@
-
`BasicTree`
新增
`clickRowToExpand`
,用于单击树节点展开
-
新增 SvgIcon 插件及示例
-
账号管理界面增加左侧部门树
### ⚡ Performance Improvements
...
...
@@ -22,6 +23,7 @@
-
修复账号管理新增未清空旧数据
-
form 组件应允许 setFieldsValue 方法值为 null 或者 undefined
-
确保单级面包屑正确跳转
-
确保 Form 组件不校验隐藏的表单项
## 2.0.2 (2021-03-04)
...
...
src/components/Form/src/components/FormItem.tsx
View file @
43a45b7c
...
...
@@ -97,7 +97,7 @@ export default defineComponent({
return
disabled
;
});
function
getShow
()
{
function
getShow
()
:
{
isShow
:
boolean
;
isIfShow
:
boolean
}
{
const
{
show
,
ifShow
}
=
props
.
schema
;
const
{
showAdvancedButton
}
=
props
.
formProps
;
const
itemIsAdvanced
=
showAdvancedButton
...
...
@@ -151,6 +151,10 @@ export default defineComponent({
const
{
rulesMessageJoinLabel
:
globalRulesMessageJoinLabel
}
=
props
.
formProps
;
if
(
requiredRuleIndex
!==
-
1
)
{
const
rule
=
rules
[
requiredRuleIndex
];
const
{
isShow
}
=
getShow
();
if
(
!
isShow
)
{
rule
.
required
=
false
;
}
if
(
rule
.
required
&&
component
)
{
if
(
!
Reflect
.
has
(
rule
,
'
type
'
))
{
rule
.
type
=
'
string
'
;
...
...
src/components/Form/src/hooks/useFormEvents.ts
View file @
43a45b7c
...
...
@@ -183,6 +183,7 @@ export function useFormEvents({
async
function
validateFields
(
nameList
?:
NamePath
[]
|
undefined
)
{
return
unref
(
formElRef
)?.
validateFields
(
nameList
);
}
async
function
validate
(
nameList
?:
NamePath
[]
|
undefined
)
{
return
await
unref
(
formElRef
)?.
validate
(
nameList
);
}
...
...
src/views/demo/system/account/account.data.ts
View file @
43a45b7c
...
...
@@ -61,7 +61,7 @@ export const accountFormSchema: FormSchema[] = [
label
:
'
密码
'
,
component
:
'
InputPassword
'
,
required
:
true
,
show
:
tru
e
,
show
:
fals
e
,
},
{
label
:
'
角色
'
,
...
...
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