提交 849f15b2 作者: 翁进城

修正筛选组件样式

上级 5b4c06f4
......@@ -23,19 +23,26 @@ export default function CategoryItem(props: Props) {
})
}
const showCount = 14; //展示数量
return (
<div className={styles.filterItem}>
<div className={styles.filterItemTitle}>{props.typeName}</div>
<div
className={`${styles.filterItemMain} ${
data.length <= 10 && styles.disabled
data.length <= showCount && styles.disabled
}`}
>
<Collapse ghost collapsible="icon" expandIconPosition="end">
<Collapse
ghost
collapsible="icon"
expandIconPosition="end"
style={{ width: "100%" }}
>
<Collapse.Panel
header={
<Space size={40}>
{data.slice(0, 10).map((item) => {
<Space size={[40, 0]}>
{data.slice(0, showCount).map((item) => {
return (
<Button
type="link"
......@@ -44,14 +51,14 @@ export default function CategoryItem(props: Props) {
>
{item.name}
</Button>
)
);
})}
</Space>
}
key="1"
>
<Space size={40}>
{data.slice(10).map((item) => {
{data.slice(showCount).map((item) => {
return (
<Button
type="link"
......@@ -60,12 +67,12 @@ export default function CategoryItem(props: Props) {
>
{item.name}
</Button>
)
);
})}
</Space>
</Collapse.Panel>
</Collapse>
</div>
</div>
)
);
}
......@@ -31,6 +31,7 @@
flex: 1;
display: flex;
justify-content: space-between;
overflow: hidden;
&.disabled {
:global .ant-collapse-expand-icon {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论