I have a vue component and it pass the string to nested vue component as follow,
<products-by-category :category="this.value"></products-by-category>
following section shows how I try to use that passed string in that nested vue component. but it is not getting that string to <span>. what is the wrong with it??
<template>
<span>Category : {{ categories }}</span>
</template>
<script>
export default {
name: "ProductsByCategory",
props: {
category: {
type: String,
default: function (){
return ''
}
}
},
data(){
return {
categories: this.category
}
}
}
</script>
<style scoped>
</style>