Currently, I am utilizing props in Vue Class components. Within the constructor, I have defined the props without a value. This setup compiles and operates smoothly, except after the most recent VS Code / TSLint update, a warning message emerges:
The property 'tag' does not have an initializer and is not definitively assigned in the constructor.
Vue Class Component
export default class Browser extends Vue {
@Prop({default: '', required:false})
tag: string
created(){
console.log("the tag prop is " + this.tag)
}
}
Should I choose to assign a value, I receive a Vue warning cautioning against directly modifying a Prop in a child component.
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders
Given that this appears to be primarily a linting issue, is there a way to deactivate this warning? Or is my code structure fundamentally incorrect?