Vue3+ts+cli: get dom elements in setup

Implementation principle : Obtain the corresponding dom element by defining the ref variable with the same name in dom

Enter the red icon below:
insert image description here
Note: Be sure to export the defined variable with the same name as ref! Export! Export! ! ! Otherwise value is always null.

Guess you like

Origin blog.csdn.net/weixin_44439874/article/details/121862062