fix: 修复输入项目名称,点击enter键,项目没有创建成功,页面没有提示

Closes 819
This commit is contained in:
wenyann 2020-11-25 15:38:58 +08:00
parent 4122a81100
commit 4bd6c8ec71
1 changed files with 13 additions and 1 deletions

View File

@ -204,6 +204,7 @@ export default {
});
}
},
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
@ -282,7 +283,18 @@ export default {
},
openEnvironmentConfig(project) {
this.$refs.environmentConfig.open(project.id);
}
},
handleEvent(event) {
if (event.keyCode === 13) {
this.submit('form')
}
},
},
created() {
document.addEventListener('keydown', this.handleEvent)
},
beforeDestroy() {
document.removeEventListener('keydown', this.handleEvent);
}
}
</script>