需求:當我在登陸頁面輸入密碼和帳號後,按下回車鍵實現登陸javascript
mounted(){ let _this = this document.onkeydown = function(e) { if(e.keyCode === 13){ _this.submitForm('ruleForm') //這裏調用的是點擊按鈕登陸的事件 } } }