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
b9d3d60e
Commit
b9d3d60e
authored
Nov 26, 2020
by
Lan
Committed by
GitHub
Nov 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: Add the style injection of the top row to the form. (#102)
Co-authored-by:
NorthLan
<
lan6995@gmail.com
>
parent
dc09de1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
BasicForm.vue
src/components/Form/src/BasicForm.vue
+7
-1
props.ts
src/components/Form/src/props.ts
+3
-0
form.ts
src/components/Form/src/types/form.ts
+3
-0
No files found.
src/components/Form/src/BasicForm.vue
View file @
b9d3d60e
<
template
>
<
template
>
<Form
v-bind=
"
{ ...$attrs, ...$props }" ref="formElRef" :model="formModel">
<Form
v-bind=
"
{ ...$attrs, ...$props }" ref="formElRef" :model="formModel">
<Row
:class=
"getProps.compact ? 'compact-form-row' : ''"
>
<Row
:class=
"getProps.compact ? 'compact-form-row' : ''"
:style=
"getRowWrapStyleRef"
>
<slot
name=
"formHeader"
/>
<slot
name=
"formHeader"
/>
<template
v-for=
"schema in getSchema"
:key=
"schema.field"
>
<template
v-for=
"schema in getSchema"
:key=
"schema.field"
>
<FormItem
<FormItem
...
@@ -71,6 +71,11 @@
...
@@ -71,6 +71,11 @@
const
schemaRef
=
ref
<
Nullable
<
FormSchema
[]
>>
(
null
);
const
schemaRef
=
ref
<
Nullable
<
FormSchema
[]
>>
(
null
);
const
formElRef
=
ref
<
Nullable
<
FormActionType
>>
(
null
);
const
formElRef
=
ref
<
Nullable
<
FormActionType
>>
(
null
);
const
getRowWrapStyleRef
=
computed
(():
any
=>
{
const
{
baseRowStyle
}
=
unref
(
getProps
);
return
baseRowStyle
||
{};
});
const
getMergePropsRef
=
computed
(
const
getMergePropsRef
=
computed
(
():
FormProps
=>
{
():
FormProps
=>
{
return
deepMerge
(
cloneDeep
(
props
),
unref
(
propsRef
));
return
deepMerge
(
cloneDeep
(
props
),
unref
(
propsRef
));
...
@@ -207,6 +212,7 @@
...
@@ -207,6 +212,7 @@
getActionPropsRef
,
getActionPropsRef
,
defaultValueRef
,
defaultValueRef
,
advanceState
,
advanceState
,
getRowWrapStyleRef
,
getProps
,
getProps
,
formElRef
,
formElRef
,
getSchema
,
getSchema
,
...
...
src/components/Form/src/props.ts
View file @
b9d3d60e
...
@@ -28,6 +28,9 @@ export const basicProps = {
...
@@ -28,6 +28,9 @@ export const basicProps = {
type
:
Object
as
PropType
<
any
>
,
type
:
Object
as
PropType
<
any
>
,
default
:
null
,
default
:
null
,
},
},
baseRowStyle
:
{
type
:
Object
as
PropType
<
any
>
,
},
baseColProps
:
{
baseColProps
:
{
type
:
Object
as
PropType
<
any
>
,
type
:
Object
as
PropType
<
any
>
,
},
},
...
...
src/components/Form/src/types/form.ts
View file @
b9d3d60e
...
@@ -53,6 +53,9 @@ export interface FormProps {
...
@@ -53,6 +53,9 @@ export interface FormProps {
// Col configuration for the entire form
// Col configuration for the entire form
wrapperCol
?:
Partial
<
ColEx
>
;
wrapperCol
?:
Partial
<
ColEx
>
;
// General row style
baseRowStyle
?:
object
;
// General col configuration
// General col configuration
baseColProps
?:
Partial
<
ColEx
>
;
baseColProps
?:
Partial
<
ColEx
>
;
...
...
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