Vue custom instruction binds a function, how to pass parameters to the function?

< 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!

Dec.13,2021

it should be written this way

<div v-mydirect:fn="item"></div>
Vue.directive('mydirect', {
    bind (el, binding,vnode) {
        let that = vnode.context
        that[binding.arg](binding.value)
    }
})

you can change fn to the form of higher-order functions

fn(i){
    return ()=>{
        console.log(i)
    }
  }

if you just want to get item, directly vmurmyDirect= "item" .

The fn in

vmurmydirection = "fn (item)" should be methods or computed

within the component.
Menu