vue默认input获取焦点

vue默认input获取焦点

html:

<input ref='gain' type="text" v-model="mesnum"/>

js:必须有外层

this.$nextTick( () =>{
	this.$refs.gain.focus()
})

发布了46 篇原创文章 · 获赞 6 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_33327325/article/details/88894340