Skip to content

Commit 0b02b4f

Browse files
committed
feat(CDropdown): add the offset property
1 parent 6286039 commit 0b02b4f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/coreui-vue/src/components/dropdown/CDropdown.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ const CDropdown = defineComponent({
118118
* Toggle the disabled state for the component.
119119
*/
120120
disabled: Boolean,
121+
/**
122+
* Offset of the dropdown menu relative to its target.
123+
*
124+
* @since 4.9.0-beta.2
125+
*/
126+
offset: {
127+
type: Array,
128+
default: () => [0, 2],
129+
},
121130
/**
122131
* Describes the placement of your component after Popper.js has applied all the modifiers that may have flipped or altered the originally provided placement property.
123132
*
@@ -177,6 +186,14 @@ const CDropdown = defineComponent({
177186
const { initPopper, destroyPopper } = usePopper()
178187

179188
const popperConfig = {
189+
modifiers: [
190+
{
191+
name: 'offset',
192+
options: {
193+
offset: props.offset,
194+
},
195+
},
196+
],
180197
placement: getPlacement(
181198
props.placement,
182199
props.direction,

0 commit comments

Comments
 (0)