this.$refs无法获取ref的值

image.png
showInput() { this.inputVisible = true; this.$nextTick(\_ => { this.$refs.saveTagInput.$refs.input.focus(); }); },

无法获得ref的值:Error in nextTick: "TypeError: Cannot read property '$refs' of undefined"

阅读 5.5k
2 个回答

你得确认你的this是谁?this.$refs有什么?this.$refs.saveTagInput又是什么?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题