[Vuejs]-Vue: When an object has many properties, how do you pass it as a prop to a child?

2👍

this functionality is possible with vue’s existing v-bind functionality

<!-- pass down parent props in common with a child component -->
<child-component v-bind="$props"></child-component>

this will pass all the props, which is helpful if you have a wrapper component and want to pass down all props to the child. You can also use a computed value to generate an object if you want to include/exclude data or props.

docs: https://v2.vuejs.org/v2/api/#v-bind

👤Daniel

Leave a comment