Работа с keyHook, мелкий рефакторинг
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user