Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
球球不吃虾
vue-vben-admin
提交
93f9a19a
V
vue-vben-admin
项目概览
球球不吃虾
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
93f9a19a
编写于
8月 13, 2021
作者:
无
无木
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(form): add `alwaysShowLines` prop
允许设置Form折叠时始终保持显示状态的行数 close: #1051
上级
61d853e6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
3 deletion
+20
-3
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
src/components/Form/src/hooks/useAdvanced.ts
src/components/Form/src/hooks/useAdvanced.ts
+1
-1
src/components/Form/src/props.ts
src/components/Form/src/props.ts
+2
-0
src/components/Form/src/types/form.ts
src/components/Form/src/types/form.ts
+2
-0
src/views/demo/form/AdvancedForm.vue
src/views/demo/form/AdvancedForm.vue
+14
-2
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
93f9a19a
...
...
@@ -3,6 +3,7 @@
### ✨ Features
-
**BasicTree**
添加搜索功能相关属性和方法
-
**BasicForm**
新增
`alwaysShowLines`
用于设置折叠时保留显示的行数
### 🐛 Bug Fixes
...
...
src/components/Form/src/hooks/useAdvanced.ts
浏览文件 @
93f9a19a
...
...
@@ -103,7 +103,7 @@ export default function ({
}
return
{
isAdvanced
:
advanceState
.
isAdvanced
,
itemColSum
};
}
if
(
itemColSum
>
BASIC_COL_LEN
)
{
if
(
itemColSum
>
BASIC_COL_LEN
*
(
unref
(
getProps
).
alwaysShowLines
||
1
)
)
{
return
{
isAdvanced
:
advanceState
.
isAdvanced
,
itemColSum
};
}
else
{
// The first line is always displayed
...
...
src/components/Form/src/props.ts
浏览文件 @
93f9a19a
...
...
@@ -59,6 +59,8 @@ export const basicProps = {
rulesMessageJoinLabel
:
propTypes
.
bool
.
def
(
true
),
// 超过3行自动折叠
autoAdvancedLine
:
propTypes
.
number
.
def
(
3
),
// 不受折叠影响的行数
alwaysShowLines
:
propTypes
.
number
.
def
(
1
),
// 是否显示操作按钮
showActionButtonGroup
:
propTypes
.
bool
.
def
(
true
),
...
...
src/components/Form/src/types/form.ts
浏览文件 @
93f9a19a
...
...
@@ -97,6 +97,8 @@ export interface FormProps {
autoFocusFirstItem
?:
boolean
;
// Automatically collapse over the specified number of rows
autoAdvancedLine
?:
number
;
// Always show lines
alwaysShowLines
?:
number
;
// Whether to show the operation button
showActionButtonGroup
?:
boolean
;
...
...
src/views/demo/form/AdvancedForm.vue
浏览文件 @
93f9a19a
...
...
@@ -4,7 +4,7 @@
<BasicForm
@
register=
"register"
/>
</CollapseContainer>
<CollapseContainer
title=
"超过3行自动收起"
class=
"mt-4"
>
<CollapseContainer
title=
"超过3行自动收起
,折叠时保留2行
"
class=
"mt-4"
>
<BasicForm
@
register=
"register1"
/>
</CollapseContainer>
</PageWrapper>
...
...
@@ -160,14 +160,26 @@
compact
:
true
,
showAdvancedButton
:
true
,
});
const
extraSchemas
:
FormSchema
[]
=
[];
for
(
let
i
=
14
;
i
<
30
;
i
++
)
{
extraSchemas
.
push
({
field
:
'
field
'
+
i
,
component
:
'
Input
'
,
label
:
'
字段
'
+
i
,
colProps
:
{
span
:
8
,
},
});
}
const
[
register1
]
=
useForm
({
labelWidth
:
120
,
schemas
:
[...
getSchamas
(),
...
getAppendSchemas
()],
schemas
:
[...
getSchamas
(),
...
getAppendSchemas
()
,
...
extraSchemas
],
actionColOptions
:
{
span
:
24
,
},
compact
:
true
,
showAdvancedButton
:
true
,
alwaysShowLines
:
2
,
});
return
{
register
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录