From 13c730e4199efbd34476655cd300244a4858e85c Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Thu, 18 Nov 2021 08:42:26 +0000 Subject: [PATCH] add missing onMounted --- src/components/scripts/ScriptFormModal.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/scripts/ScriptFormModal.vue b/src/components/scripts/ScriptFormModal.vue index e9fe821..fd71fe1 100644 --- a/src/components/scripts/ScriptFormModal.vue +++ b/src/components/scripts/ScriptFormModal.vue @@ -94,6 +94,7 @@ // composable imports -import { ref, computed } from "vue"; +import { ref, computed, onMounted } from "vue"; import { useQuasar, useDialogPluginComponent } from "quasar"; import { saveScript, editScript, downloadScript } from "@/api/scripts"; import { useAgentDropdown } from "@/composables/agents"; @@ -181,6 +182,7 @@ export default { const code = ref(""); const maximized = ref(false); const loading = ref(false); + const agentLoading = ref(false); const title = computed(() => { if (props.script) { @@ -245,6 +247,13 @@ export default { }); } + // component life cycle hooks + onMounted(async () => { + agentLoading.value = true; + await getAgentOptions(); + agentLoading.value = false; + }); + return { // reactive data formScript: script.value, @@ -253,6 +262,7 @@ export default { loading, agentOptions, agent, + agentLoading, // non-reactive data shellOptions,