我试图在Vue.js中设置输入元素的焦点。我在网上找到了一些帮助,但这些解释对我都没有用。.$$.nameInput.focus(); // None of them worked !$els doesn't work }</script>
我尝试了this.$$.nameInput.focus();和this.$els.nameInput.<em
我想知道为什么focus()函数不能在隐藏元素上工作。例如(我正在使用Vue.js ):var vm = new Vue({ data:{ }, var vm = this;
// if I uncomment setTimeout, then the textbox can set focus$refs.textbox.f
jQuery $("#element").focus();函数在v-if中第一次不能工作。例如。true when i call this function and the div with #upc input becomes active and displayed
$("#upc").focus(); &