- 通过触发input的click事件,再触发它自身的focus事件
<input @click="inputClickFun($event)" ref="triggerInput" type="tel" maxlength="11" placeholder="请输入手机号码" v-model="loginAccount">
<button @click="trigerFun()" >点击按钮</button>
trigerFun() {
this.$refs.triggerInput.dispatchEvent(new MouseEvent('click'));
},
inputClickFun(e) {
e.target.focus();
}