Answer the question
In order to leave comments, you need to log in
How to pass data from different components?
Can't pass Input value from App component to Item component.
Tried everything I could find on google.
------------------ App -------------------
import item from './components/Item.vue'
export default {
name: "App",
components: {
item
},
data() {
return {
ipnutValue: '',
items: []
}
},
methods: {
addNote() {
this.items.push("item")
this.ipnutValue = this.itemTitle
console.log(this.ipnutValue)
this.ipnutValue = ""
console.log('Note was create')
}
},
};
------------------- Item -------------------
export default {
name: "item",
data() {
return {
itemTitle: '',
itemStatus: 'isActive',
delItem: true
}
},
methods: {
statusFun: function () {
if(this.itemStatus === 'isActive') {
this.itemStatus = 'isDone'
} else {
this.itemStatus = 'isActive'
}
console.log('Status Working')
},
DelFun() {
console.log('Del BTN Working')
}
}
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question