< template >
< div vmurf = "item in [1 record2, 3, 4]" >
<div v-mydirect="fn(item)"></div>
< / div >
< / template >
< script >
import Vue from "vue";
Vue.directive("loadmore", {
bind (el, binding) {
binding.value()
}
})
export default {
methods: {
fn (n) {
console.log(n)
}
}
}
< / script >
this method can execute a function with no arguments.
I want to execute the fn function when I execute the custom instruction, and then the function gets the item
solution from the loop through the parameters. Thank you!