DEV Community

Discussion on: Vue/Nuxt Component Card

Collapse
 
renesansz profile image
Rene Padillo 🇵🇭 • Edited

Regarding your ContactCard component, you have to use props instead of data when you want to pass data to another component via v-bind or :

There are multiple ways to declare props:

  • you can pass an array of attributes
export default {
   props: ['src', 'alt', 'title'],
}
  • you declare it with properties and/or with default values
export default {
   props: {
      src: {
        type: String,
        required: true,
      },
      title: {
        type: String,
        default: '',
      },
   }
}

See more details about props in the official documentation.