在实际运用中这2种方式都不好使:@keyup.enter.native 和 @keyup.enter
下面用全局的方式做就没问题:
created() {
// 绑定全局的回车事件
let that = this
document.onkeydown = function(e){
let key = window.event.keyCode
if(key != 13) return;
//查询页面打开状态
if(that.$refs.xDown3.isPanelVisible()==true){
that.handleQuery();
}
//添加、编辑打开了
if(that.open == true){
that.submitForm();
}
}
},