extraProps for defineComponent() or defineExtraProps() #10983
samedkucuk
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In component libraries, the default props values can be requested to be different from project to project, so we re-enter the props values every time a component is used, or we write an extra component for this and try to transfer all the features of the component. I started to create a UI library from the components I use and I know that I want to use a different default props in each project. Existing techniques do not offer a solution for this.
In functions like cloneVNode(h(Component)), defineComponent(h(Component)), reactivity can be broken or some properties cannot be passed, the default value of the modelValue create with defineModel() for defineComponent does not change without binding a v-model to the component with an in-component function.
Moreover, if I need to dynamically change the props in a component that I transfer via slot, I cannot change it in an easy way.
For this, it would be great if there is an arg on defineComponent() that we can add extra props or a function called defineExtraProps() that we can add extra props to the component.
Beta Was this translation helpful? Give feedback.
All reactions