提交 849f15b2 作者: 翁进城

修正筛选组件样式

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