1.话不多说,先来个小漩涡
2.上代码

 <el-button type="primary" v-on:keyup.13.native="submit"  @click="submitForm('ruleForm2')" size="medium">登&nbsp;录</el-button>
created(){
	var _this = this;
    document.onkeydown = function(e) {
      let key = window.event.keyCode;
      if (key == 13) {
        _this.submit();
      }
    };
}
methods(){
	submit(){
      this.submitForm()
    },
}
Logo

前往低代码交流专区

更多推荐