
1、原生基礎組件
<button @click="myFocus" ref="toFocus"><button> this.$refs.toFocus.focus();
2、封裝組件、element組件等
需要多加一層 .$el
<el-button type="primary" size="mini" @click="routerLink" ref="buttonFocus">信息維護</el-button> this.$refs.buttonFocus.$el.focus();

1、原生基礎組件
<button @click="myFocus" ref="toFocus"><button> this.$refs.toFocus.focus();
2、封裝組件、element組件等
需要多加一層 .$el
<el-button type="primary" size="mini" @click="routerLink" ref="buttonFocus">信息維護</el-button> this.$refs.buttonFocus.$el.focus();
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。