parent component declares function
methods: {
edit(index, val) {
console.log(index)
console.log(val) //
}
}
parent component calls child component to pass props
// editindex
<Child v-for="(item, index) in items" @editFn="edit(index)">
Sub-component trigger function
editHandler() {
const value = "hello"
this.$emit("editFn", value) //value
}