Skip to content

Commit 0599f4b

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

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
@@ -171,7 +171,8 @@ defineExpose({ toggleOpenState, open, close });
171171
<VbenPopover
172172
v-model:open="visible"
173173
:content-props="{ align: 'end', alignOffset: -11, sideOffset: 8 }"
174-
content-class="p-0 pt-3"
174+
content-class="p-0 pt-3 w-full"
175+
trigger-class="w-full"
175176
>
176177
<template #trigger>
177178
<template v-if="props.type === 'input'">
@@ -183,6 +184,11 @@ defineExpose({ toggleOpenState, open, close });
183184
role="combobox"
184185
:aria-label="$t('ui.iconPicker.placeholder')"
185186
aria-expanded="visible"
187+
:[`onUpdate:${modelValueProp}`]="
188+
(v: string) => {
189+
currentSelect = v;
190+
}
191+
"
186192
v-bind="$attrs"
187193
>
188194
<template #[iconSlot]>

0 commit comments

Comments
 (0)