Работа с keyHook, мелкий рефакторинг

This commit is contained in:
Book Pauk
2019-01-11 02:13:46 +07:00
parent 64bff259ff
commit a30fd57afb
3 changed files with 14 additions and 9 deletions

View File

@@ -32,11 +32,6 @@ class LoaderPage extends Vue {
}
mounted() {
//недостатки сторонних ui
this.$refs.input.$refs.input.addEventListener('keyup', (event) => {
if (event.key == 'Enter')
this.submitUrl();
});
}
activated() {
@@ -55,6 +50,12 @@ class LoaderPage extends Vue {
//loadUrl()
;
}
keyHook(event) {
//недостатки сторонних ui
if (document.activeElement == this.$refs.input.$refs.input && event.type == 'keyup' && event.key == 'Enter')
this.submitUrl();
}
}
//-----------------------------------------------------------------------------
</script>