vue默认input获取焦点 html: <input ref='gain' type="text" v-model="mesnum"/> js:必须有外层 this.$nextTick( () =>{ this.$refs.gain.focus() })