Vue Multi Ref
This is a directive to help use same ref
on more than one element.
Big thanx to @Herteby & @LinusBorg. 🔥🤘👏
Installation
npm install vue-multi-ref --save
Usage
-
register the directive
el: '#app'or using Vue as global variable
windowVue =el: '#app' -
now add
v-multi-ref:refName
to any number of elements that you want to have the same ref, ex.refName
could be- camelCase =
refName
- kebab-case =
ref-name
- snake-case =
ref_name
- camelCase =
abc -
result
// console.log(this.$refs['my-ref'])> my-ref: 3 div li a