showInput() { this.inputVisible = true; this.$nextTick(\_ => { this.$refs.saveTagInput.$refs.input.focus(); }); },
无法获得ref的值:Error in nextTick: "TypeError: Cannot read property '$refs' of undefined"
showInput() { this.inputVisible = true; this.$nextTick(\_ => { this.$refs.saveTagInput.$refs.input.focus(); }); },
无法获得ref的值:Error in nextTick: "TypeError: Cannot read property '$refs' of undefined"
10 回答11.1k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决
3 回答5.1k 阅读✓ 已解决
3 回答1.8k 阅读✓ 已解决
2 回答4.7k 阅读✓ 已解决
你得确认你的
this
是谁?this.$refs
有什么?this.$refs.saveTagInput
又是什么?