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"
13 回答12.8k 阅读
8 回答2.6k 阅读
2 回答5.1k 阅读✓ 已解决
9 回答1.7k 阅读✓ 已解决
3 回答2.2k 阅读✓ 已解决
5 回答894 阅读
6 回答1k 阅读
你得确认你的
this
是谁?this.$refs
有什么?this.$refs.saveTagInput
又是什么?