vue3中使用nextTick vue2中使用vue3中使用![在这里插入图片描述](https://img-blog.csdnimg.cn/9ba8ec87631c4d22b29178349a8089ab.png) vue2中使用 this.$nextTick(() => { //你要执行的方法 }) vue3中使用 1、引入nextTick import { nextTick } from 'vue' 2、使用 setup () { const passwordRef = ref(null) nextTick(()=>{ passwordRef.value.focus() }) return { passwordRef } }