Skip to content

Commit

Permalink
refactor(KtField*Select*): Use $props on Template Instead of Manually…
Browse files Browse the repository at this point in the history
… Exposing props

Co-Authored-By: Carol Soliman <[email protected]>
  • Loading branch information
FlorianWendelborn and carsoli committed Jan 15, 2024
1 parent 290a6ab commit 260f96f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<GenericSelectField
v-bind="props"
v-bind="$props"
:helpTextSlot="$slots.helpText"
isMultiple
@emit="onEmit"
Expand All @@ -25,12 +25,11 @@ export default defineComponent({
GenericSelectField,
},
props: makeProps(KottiFieldMultiSelect.propsSchema),
setup(props: KottiFieldMultiSelect.PropsInternal, { emit }) {
setup(_, { emit }) {
return {
onEmit: ({ event, payload }: { event: string; payload: unknown }) => {
emit(event, payload)
},
props,
}
},
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<GenericSelectField
v-bind="props"
v-bind="$props"
:helpTextSlot="$slots.helpText"
isMultiple
isRemote
Expand All @@ -26,12 +26,11 @@ export default defineComponent({
GenericSelectField,
},
props: makeProps(KottiFieldMultiSelectRemote.propsSchema),
setup(props: KottiFieldMultiSelectRemote.PropsInternal, { emit }) {
setup(_, { emit }) {
return {
onEmit: ({ event, payload }: { event: string; payload: unknown }) => {
emit(event, payload)
},
props,
}
},
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<GenericSelectField
v-bind="props"
v-bind="$props"
:helpTextSlot="$slots.helpText"
@emit="onEmit"
>
Expand All @@ -24,12 +24,11 @@ export default defineComponent({
GenericSelectField,
},
props: makeProps(KottiFieldSingleSelect.propsSchema),
setup(props: KottiFieldSingleSelect.PropsInternal, { emit }) {
setup(_, { emit }) {
return {
onEmit: ({ event, payload }: { event: string; payload: unknown }) => {
emit(event, payload)
},
props,
}
},
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<GenericSelectField
v-bind="props"
v-bind="$props"
:helpTextSlot="$slots.helpText"
isRemote
@emit="onEmit"
Expand All @@ -25,12 +25,11 @@ export default defineComponent({
GenericSelectField,
},
props: makeProps(KottiFieldSingleSelectRemote.propsSchema),
setup(props: KottiFieldSingleSelectRemote.PropsInternal, { emit }) {
setup(_, { emit }) {
return {
onEmit: ({ event, payload }: { event: string; payload: unknown }) => {
emit(event, payload)
},
props,
}
},
})
Expand Down

0 comments on commit 260f96f

Please sign in to comment.