Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
b9d3d60e
提交
b9d3d60e
authored
11月 26, 2020
作者:
Lan
提交者:
GitHub
11月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf: Add the style injection of the top row to the form. (#102)
Co-authored-by: NorthLan <lan6995@gmail.com>
上级
dc09de1e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
1 行删除
+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
没有找到文件。
src/components/Form/src/BasicForm.vue
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
>
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论