<template> <post :id="post.id" :title="post.title" :author="post.author" /> <!-- This (↑) is the same as this (↓) --> <post v-bind="post" /> </template> <script> // <post> component definition export default { props: { id: Number, title: String, author: Object } } </script>
Vue Js Use v-bind for Prop Destructuring
Use v-bind as a kind of a “prop destructuring” instead of passing multiple object properties into a component as props
Created on Sep 11, 2021
•233 views
If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️
Load comments for Vue Js Use v-bind for Prop Destructuring
PostSrc Code Components
Collection of Tailwind CSS components for everyone to use. Browse all of the components that are right for your project.
View ComponentsSponsors 👑
+ Add YoursOther Code Snippets
All Snippets
How to get Select2 Values for Both Single and Multiselect
1 year ago

How to Specify Specific Columns When Eager Loading Relationship in Laravel
1 year ago

How to Get Last Record (Row) in Laravel
1 year ago

How to Copy Text From Textarea Using JavaScript
1 year ago

How to Restore Multiple Soft Deleted Model in Laravel
2 years ago

How to Get Currently Active Route in Laravel
2 years ago