Skip to content

Commit f1af9f8

Browse files
authored
fix: add triggerClass binding to PopoverTrigger and update icon-picker styles (#6095)
* Popover支持设置trigger的样式 * 修正icon-picker的input值更新
1 parent 0517a70 commit f1af9f8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/@core/ui-kit/shadcn-ui/src/components/popover/popover.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface Props extends PopoverRootProps {
2121
class?: ClassType;
2222
contentClass?: ClassType;
2323
contentProps?: PopoverContentProps;
24+
triggerClass?: ClassType;
2425
}
2526
2627
const props = withDefaults(defineProps<Props>(), {});
@@ -32,6 +33,7 @@ const delegatedProps = computed(() => {
3233
class: _cls,
3334
contentClass: _,
3435
contentProps: _cProps,
36+
triggerClass: _tClass,
3537
...delegated
3638
} = props;
3739
@@ -43,7 +45,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
4345

4446
<template>
4547
<PopoverRoot v-bind="forwarded">
46-
<PopoverTrigger>
48+
<PopoverTrigger :class="triggerClass">
4749
<slot name="trigger"></slot>
4850

4951
<PopoverContent

packages/effects/common-ui/src/components/icon-picker/icon-picker.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,18 @@ const searchInputProps = computed(() => {
165165
};
166166
});
167167
168+
function updateCurrentSelect(v: string) {
169+
currentSelect.value = v;
170+
}
171+
168172
defineExpose({ toggleOpenState, open, close });
169173
</script>
170174
<template>
171175
<VbenPopover
172176
v-model:open="visible"
173177
:content-props="{ align: 'end', alignOffset: -11, sideOffset: 8 }"
174-
content-class="p-0 pt-3"
178+
content-class="p-0 pt-3 w-full"
179+
trigger-class="w-full"
175180
>
176181
<template #trigger>
177182
<template v-if="props.type === 'input'">
@@ -183,6 +188,7 @@ defineExpose({ toggleOpenState, open, close });
183188
role="combobox"
184189
:aria-label="$t('ui.iconPicker.placeholder')"
185190
aria-expanded="visible"
191+
:[`onUpdate:${modelValueProp}`]="updateCurrentSelect"
186192
v-bind="$attrs"
187193
>
188194
<template #[iconSlot]>

0 commit comments

Comments
 (0)