Custom instructions are used in vue, but dom is traversed. How to operate dom in custom instructions requires + index,?

Mar.23,2021

el is the current dom, that can be used directly. The second parameter of the custom instruction can get the parameter passed by the instruction

v-anchor="index"
function(el,binding){
    var v = binding.value; // index
}
Menu