How does vue get all elements with the same class name

for example, the page dynamically generates 100 li, and each li has a .name element

<li><div class="name"></div><li>

jq is obtained by $(".name"), and then $(".name"). Length can get the length;
how does vue get all the .names and get the length?

May.07,2022

document.querySelectorAll (".name")


add ref attribute to dynamic generation, use this.$refs.ref name to get


or directly introduce jQuery, and use the original method to get it.


since vue is used to manipulate data, you can bind a data to the dom of the same class to manipulate this data

Menu