diff --git a/docs/content/3.components/input-menu.md b/docs/content/3.components/input-menu.md index 564b9f69..f678e561 100644 --- a/docs/content/3.components/input-menu.md +++ b/docs/content/3.components/input-menu.md @@ -782,6 +782,14 @@ name: 'input-menu-countries-example' :component-emits +### Expose + +When accessing the component via a template ref, you can use the following: + +| Name | Type | +| ---- | ---- | +| `inputRef`{lang="ts-type"} | `Ref \| null>`{lang="ts-type"} | + ## Theme :component-theme diff --git a/docs/content/3.components/input-number.md b/docs/content/3.components/input-number.md index 510b251b..bacc7b64 100644 --- a/docs/content/3.components/input-number.md +++ b/docs/content/3.components/input-number.md @@ -287,8 +287,8 @@ name: 'input-number-slots-example' When accessing the component via a template ref, you can use the following: | Name | Type | -|----------------------------|-------------------------------------------------| -| `inputRef`{lang="ts-type"} | `Ref`{lang="ts-type"} | +| -------------------------- | ----------------------------------------------- | +| `inputRef`{lang="ts-type"} | `Ref \| null>`{lang="ts-type"} | ## Theme diff --git a/docs/content/3.components/input-tags.md b/docs/content/3.components/input-tags.md index cada7c1f..93e677d6 100644 --- a/docs/content/3.components/input-tags.md +++ b/docs/content/3.components/input-tags.md @@ -276,8 +276,8 @@ name: 'input-tags-form-field-example' When accessing the component via a template ref, you can use the following: | Name | Type | -|----------------------------|-------------------------------------------------| -| `inputRef`{lang="ts-type"} | `Ref`{lang="ts-type"} | +| -------------------------- | ----------------------------------------------- | +| `inputRef`{lang="ts-type"} | `Ref \| null>`{lang="ts-type"} | ## Theme diff --git a/docs/content/3.components/pin-input.md b/docs/content/3.components/pin-input.md index d35853a1..77bfea79 100644 --- a/docs/content/3.components/pin-input.md +++ b/docs/content/3.components/pin-input.md @@ -180,6 +180,8 @@ props: :component-emits +### Expose + When accessing the component via a template ref, you can use the following: | Name | Type | diff --git a/docs/content/3.components/select-menu.md b/docs/content/3.components/select-menu.md index bb3d658b..f68aad1e 100644 --- a/docs/content/3.components/select-menu.md +++ b/docs/content/3.components/select-menu.md @@ -815,6 +815,14 @@ name: 'select-menu-countries-example' :component-emits +### Expose + +When accessing the component via a template ref, you can use the following: + +| Name | Type | +| ---- | ---- | +| `triggerRef`{lang="ts-type"} | `Ref \| null>`{lang="ts-type"} | + ## Theme :component-theme diff --git a/docs/content/3.components/select.md b/docs/content/3.components/select.md index 3b95bc26..d7e59ffc 100644 --- a/docs/content/3.components/select.md +++ b/docs/content/3.components/select.md @@ -709,6 +709,14 @@ collapse: true :component-emits +### Expose + +When accessing the component via a template ref, you can use the following: + +| Name | Type | +| ---- | ---- | +| `triggerRef`{lang="ts-type"} | `Ref \| null>`{lang="ts-type"} | + ## Theme :component-theme diff --git a/docs/content/3.components/tabs.md b/docs/content/3.components/tabs.md index 45b0e1fd..f555de40 100644 --- a/docs/content/3.components/tabs.md +++ b/docs/content/3.components/tabs.md @@ -242,6 +242,14 @@ You will have access to the following slots: :component-emits +### Expose + +When accessing the component via a template ref, you can use the following: + +| Name | Type | +| ---- | ---- | +| `triggersRef`{lang="ts-type"} | `Ref`{lang="ts-type"} | + ## Theme :component-theme diff --git a/src/runtime/components/Select.vue b/src/runtime/components/Select.vue index 2dc88c9e..09268beb 100644 --- a/src/runtime/components/Select.vue +++ b/src/runtime/components/Select.vue @@ -245,6 +245,10 @@ function onUpdateOpen(value: boolean) { function isSelectItem(item: SelectItem): item is SelectItemBase { return typeof item === 'object' && item !== null } + +defineExpose({ + triggerRef +}) diff --git a/src/runtime/components/SelectMenu.vue b/src/runtime/components/SelectMenu.vue index d7210e5a..06043689 100644 --- a/src/runtime/components/SelectMenu.vue +++ b/src/runtime/components/SelectMenu.vue @@ -363,6 +363,10 @@ function onSelect(e: Event, item: SelectMenuItem) { function isSelectItem(item: SelectMenuItem): item is _SelectMenuItem { return typeof item === 'object' && item !== null } + +defineExpose({ + triggerRef +}) diff --git a/src/runtime/components/Table.vue b/src/runtime/components/Table.vue index 627a2b90..67b039a2 100644 --- a/src/runtime/components/Table.vue +++ b/src/runtime/components/Table.vue @@ -226,7 +226,7 @@ const groupingState = defineModel('grouping', { default: [] }) const expandedState = defineModel('expanded', { default: {} }) const paginationState = defineModel('pagination', { default: {} }) -const tableRef = ref() +const tableRef = ref(null) const tableApi = useVueTable({ ...reactiveOmit(props, 'as', 'data', 'columns', 'caption', 'sticky', 'loading', 'loadingColor', 'loadingAnimation', 'class', 'ui'), diff --git a/src/runtime/components/Tabs.vue b/src/runtime/components/Tabs.vue index fb65af3f..f7acf755 100644 --- a/src/runtime/components/Tabs.vue +++ b/src/runtime/components/Tabs.vue @@ -79,7 +79,8 @@ export type TabsSlots = {