input主动获取焦点
原生:document.getElementById('input').focus();vue:this.$nextTick(() => {this.$refs.input.focus()})uni-app:<input ref="huifu" v-model="content" :focus="focusState" type="text" />this.focusState
·
原生:
document.getElementById('input').focus();
vue:
this.$nextTick(() => {
this.$refs.input.focus()
})
uni-app:
<input ref="huifu" v-model="content" :focus="focusState" type="text" />
this.focusState = false;
this.$nextTick(function() {
this.focusState = true;
});
更多推荐
已为社区贡献1条内容
所有评论(0)