1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat: query tabs auto focus

This commit is contained in:
2020-12-11 15:55:18 +01:00
parent 3ed5ea023e
commit f81312aeb0
4 changed files with 25 additions and 8 deletions

View File

@ -14,7 +14,8 @@ monaco.languages.registerCompletionItemProvider('sql', completionItemProvider(mo
export default {
name: 'QueryEditor',
props: {
value: String
value: String,
autoFocus: { type: Boolean, default: false }
},
data () {
return {
@ -40,6 +41,12 @@ export default {
const content = this.editor.getValue();
this.$emit('update:value', content);
});
if (this.autoFocus) {
setTimeout(() => {
this.editor.focus();
}, 20);
}
},
beforeDestroy () {
this.editor && this.editor.dispose();