mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
feat(UI): esc key to cancel cell edit
This commit is contained in:
@ -74,6 +74,12 @@ export default {
|
||||
else return '';
|
||||
}
|
||||
},
|
||||
created () {
|
||||
window.addEventListener('keydown', this.onKey);
|
||||
},
|
||||
beforeDestroy () {
|
||||
window.removeEventListener('keydown', this.onKey);
|
||||
},
|
||||
methods: {
|
||||
confirmModal () {
|
||||
this.$emit('confirm');
|
||||
@ -82,6 +88,11 @@ export default {
|
||||
|
||||
hideModal () {
|
||||
this.$emit('hide');
|
||||
},
|
||||
onKey (e) {
|
||||
e.stopPropagation();
|
||||
if (e.key === 'Escape')
|
||||
this.hideModal();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user