created中:

Vue监听回车事件enter_系统

created: function() {
var _this = this;
document.onkeydown = function(e) { //按下回车提交
let key = window.event.keyCode;
//事件中keycode=13为回车事件
if (key == 13) {
_this.append();
}
};
},

methods

append: function() {
alert("我是回车");
},