-
Notifications
You must be signed in to change notification settings - Fork 342
Closed
Description
It would be good that this type was exported so it could help with props that are shared with other components (formerly mixins).
Example use case:
export const sharedProps = {
disabled: Boolean,
}
export function getSharedPropBindings (props: ExtractPropTypes<typeof sharedProps>) {
return computed(() => ({
disabled: props.disabled,
}))
}
Later in component:
Script
import { sharedProps, getSharedPropBindings } from './sharedProps'
// setup block
const sharedPropBindings = getSharedPropBindings(props)
Template
<component v-bind="sharedPropBindings" />
Metadata
Metadata
Assignees
Labels
No labels