Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
live-management-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
live-management-web
Commits
4320b0ed
Commit
4320b0ed
authored
Aug 22, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化form表单
parent
057391f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/components/form/index.tsx
+4
-2
No files found.
src/components/form/index.tsx
View file @
4320b0ed
...
@@ -10,7 +10,7 @@ export default defineComponent({
...
@@ -10,7 +10,7 @@ export default defineComponent({
setup
(
props
,
{
emit
,
slots
})
{
setup
(
props
,
{
emit
,
slots
})
{
const
newRule
=
ref
<
any
>
({});
const
newRule
=
ref
<
any
>
({});
const
ewriteRules
=
()
=>
{
const
ewriteRules
=
()
=>
{
const
{
data
,
rules
}
=
props
;
const
{
rules
}
=
props
;
Object
.
keys
(
rules
).
forEach
((
key
:
string
)
=>
{
Object
.
keys
(
rules
).
forEach
((
key
:
string
)
=>
{
rules
[
key
].
forEach
((
item
:
any
)
=>
{
rules
[
key
].
forEach
((
item
:
any
)
=>
{
// 是否显示error
// 是否显示error
...
@@ -58,7 +58,9 @@ export default defineComponent({
...
@@ -58,7 +58,9 @@ export default defineComponent({
if
(
formValidation
(
rule
,
data
[
key
]))
{
if
(
formValidation
(
rule
,
data
[
key
]))
{
rule
.
leShow
=
false
;
rule
.
leShow
=
false
;
}
else
{
}
else
{
// 只显示一条error
rule
.
leShow
=
true
;
rule
.
leShow
=
true
;
break
;
}
}
}
}
}
}
...
@@ -96,7 +98,7 @@ export default defineComponent({
...
@@ -96,7 +98,7 @@ export default defineComponent({
}
}
}
}
}
}
// 通知
tab_panel
// 通知
emit
(
'submit'
,
{
emit
(
'submit'
,
{
result
:
status
,
result
:
status
,
firstError
:
message
[
0
],
firstError
:
message
[
0
],
...
...
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