Add additional frontend hooks (#2073)

This commit is contained in:
Ahsan Virani 2021-08-13 12:01:12 +02:00 committed by GitHub
parent 309324f60f
commit 31cf43c294
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -18,9 +18,12 @@
</template>
<script lang="ts">
import Vue from "vue";
export default Vue.extend({
import mixins from 'vue-typed-mixins';
import { externalHooks } from '@/components/mixins/externalHooks';
export default mixins(externalHooks).extend({
name: "SearchBar",
props: ["value", "eventBus"],
mounted() {
@ -32,6 +35,8 @@ export default Vue.extend({
setTimeout(() => {
this.focus();
}, 0);
this.$externalHooks().run('nodeCreator_searchBar.mount', { inputRef: this.$refs['input'] });
},
methods: {
focus() {

View file

@ -134,6 +134,7 @@ import ExpressionEdit from '@/components/ExpressionEdit.vue';
// @ts-ignore
import PrismEditor from 'vue-prism-editor';
import TextEdit from '@/components/TextEdit.vue';
import { externalHooks } from '@/components/mixins/externalHooks';
import { genericHelpers } from '@/components/mixins/genericHelpers';
import { nodeHelpers } from '@/components/mixins/nodeHelpers';
import { showMessage } from '@/components/mixins/showMessage';
@ -142,6 +143,7 @@ import { workflowHelpers } from '@/components/mixins/workflowHelpers';
import mixins from 'vue-typed-mixins';
export default mixins(
externalHooks,
genericHelpers,
nodeHelpers,
showMessage,
@ -621,6 +623,8 @@ export default mixins(
}
}
}
this.$externalHooks().run('parameterInput.mount', { parameter: this.parameter, inputFieldRef: this.$refs['inputField'] });
},
});
</script>