<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
323
3 years ago
0 comments
Use v-bind as a kind of a “prop destructuring” instead of passing multiple object properties into a component as props.
Topics:
Frontend
Resource
Average
Average
Support Us
If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️
Leave a reply