Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
93f9a19a
提交
93f9a19a
authored
8月 13, 2021
作者:
无木
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(form): add `alwaysShowLines` prop
允许设置Form折叠时始终保持显示状态的行数 close: #1051
上级
61d853e6
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
20 行增加
和
3 行删除
+20
-3
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
useAdvanced.ts
src/components/Form/src/hooks/useAdvanced.ts
+1
-1
props.ts
src/components/Form/src/props.ts
+2
-0
form.ts
src/components/Form/src/types/form.ts
+2
-0
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
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论