Skip to content

Commit 2c24348

Browse files
committed
refactor: update usePolarisAttrs to use generic types and correct excluded props
1 parent 39c803e commit 2c24348

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/runtime/components/polaris/UiSaveBar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ const emit = defineEmits<{
4343
(e: 'show' | 'hide', event: Event): void
4444
}>()
4545
46-
const polarisAttrs = usePolarisAttrs(props, ['primaryAction', 'secondaryAction'])
46+
const polarisAttrs = usePolarisAttrs(props, ['id', 'discardConfirmation'])
4747
</script>

src/runtime/components/polaris/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { computed, useAttrs } from 'vue'
66
* This utility re-adds only the props that were actually passed by the parent,
77
* avoiding setting undefined values on custom elements which can alter their behavior.
88
*/
9-
export function usePolarisAttrs(
10-
props: Record<string, unknown>,
11-
exclude?: string[]
9+
export function usePolarisAttrs<T extends Record<string, unknown>>(
10+
props: T,
11+
exclude?: (keyof T)[]
1212
) {
1313
const attrs = useAttrs()
1414
return computed(() => {

0 commit comments

Comments
 (0)