Skip to content

Commit

Permalink
feat(SelectTrigger): 折叠的 Tag 弹出框增加滚动条
Browse files Browse the repository at this point in the history
  • Loading branch information
1zumii committed Apr 18, 2024
1 parent 097f37b commit 6254b1b
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions components/select-trigger/selectTrigger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,34 @@
{{ tag.label }}
</Tag>
<template #content>
<Tag
v-for="(
collapsedTag, collapsedTagIndex
) in tag.collapsedOptions"
:key="collapsedTagIndex"
type="info"
size="small"
:class="[
`${prefixCls}-label-item`,
`${prefixCls}-label-collapsed-item`,
]"
:closable="collapsedTag.closable"
:bordered="hasTagBordered"
@close="
handleRemove(
calcCollapseTagIndex(
collapsedTagIndex,
),
)
"
>
<Ellipsis
:class="`${prefixCls}-label-text`"
:content="collapsedTag.label"
/>
</Tag>
<Scrollbar :maxHeight="500">
<Tag
v-for="(
collapsedTag, collapsedTagIndex
) in tag.collapsedOptions"
:key="collapsedTagIndex"
type="info"
size="small"
:class="[
`${prefixCls}-label-item`,
`${prefixCls}-label-collapsed-item`,
]"
:closable="collapsedTag.closable"
:bordered="hasTagBordered"
@close="
handleRemove(
calcCollapseTagIndex(
collapsedTagIndex,
),
)
"
>
<Ellipsis
:class="`${prefixCls}-label-text`"
:content="collapsedTag.label"
/>
</Tag>
</Scrollbar>
</template>
</Tooltip>
</template>
Expand Down Expand Up @@ -201,7 +203,8 @@ import getPrefixCls from '../_util/getPrefixCls';
import { useTheme } from '../_theme/useTheme';
import Ellipsis from '../ellipsis';
import Tooltip from '../tooltip';
import Tag from '../tag/tag.vue';
import Tag from '../tag';
import Scrollbar from '../scrollbar';
import UpOutlined from '../icon/UpOutlined';
import DownOutlined from '../icon/DownOutlined';
import CloseCircleFilled from '../icon/CloseCircleFilled';
Expand Down Expand Up @@ -241,6 +244,7 @@ export default defineComponent({
name: 'FSelect',
components: {
Tag,
Scrollbar,
Ellipsis,
Tooltip,
UpOutlined,
Expand Down

0 comments on commit 6254b1b

Please sign in to comment.