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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b340ee-2b736.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b340ee-2b736.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?