After browsing online, I attempted to pass props to data in the following manner:
Child Component:
props: {
idInput: { type: String, required: false },
nameInput: { type: String, required: false },
},
data() {
return {
id: this.idInput,
name: this.nameInput,
}
}
This allows me to utilize it here:
<t-input v-model="name" type="text" />
Parent Component:
data() { return { game: {} } },
beforeCreated() { this.game = { name: "myName", id: "myID" }
<ChildComponent :name-input="game.name" :id-input="game.id" />
The issue arises when "name" appears as undefined. However, if I alter it to "nameInput", it functions properly but triggers a Vue error warning against using props that way. Any suggestions?