I have a vue component that is page.vue. And I have a child vue component that is card.vue as shown below.
I can't get it to work with injecting data into the card(child) component.
I tried injecting data inside and in the data function for the page component.
Page.vue
<template>
<div class="container">
<card></card>
</div>
</template>
<script>
import Card from "../Card.vue"
export default {
name: 'skills',
components: {
"card": Card
},
data: function() {
return {
message: "Skills"
}
}
}
</script>
Card.vue
<template>
<div class="container drop-shadow">
</div>
</template>
<script>
export default {
name: 'card',
data: function() {
return {
data: "",
}
}
}
</script>
I want that card is reusable from other components also other than Page.vue. Need to inject data into card respective to where it is displayed.