I am facing a frustrating issue that seems to be driving me crazy. Despite my understanding of not mutating a prop and why it can lead to errors, I am certain that I am not doing so in this case. Can someone please assist me with resolving this error?
Here is the component causing trouble:
<template>
<h2>
{{ title }}
</h2>
</template>
<script lang="ts">
import { Component, Vue, Prop } from 'nuxt-property-decorator'
@Component({})
export default class Navbar extends Vue {
@Prop() title!: string
}
</script>
I am calling it like this:
<TopHeader title="Generate Report"/>
Despite my efforts, I keep encountering the following error message:
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "title"
found in
---> <Navbar> at components/TopHeader.vue
This appears to be a bug, even though I have updated to the latest versions of nuxt
, nuxt-property-decorator
, and vue
(prior to vue 3). Has anyone else faced this issue and can offer some guidance?
"dependencies": {
"@nuxtjs/axios": "^5.13.1",
"lodash": "^4.17.21",
"nuxt": "^2.15.8",
"nuxt-buefy": "^0.4.21",
"nuxt-property-decorator": "^2.9.1",
"vue": "^2.6.14",
"vue-server-renderer": "^2.6.14",
"vue-template-compiler": "^2.6.14",
"webpack": "^4.46.0"
},