Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

vue回车聚焦下一个input,动态绑定ref出现,refs拿到为undefined

image.png
image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  1. _this.$refs.label.foucs()
  2. _this.$refs[label].focus()
  3. _this.$refs['label'].focus()

上述三个有什么不同?


既然懂了,那么很明显,你读取的并不是你想要的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...