diff --git a/core/core-frontend/src/components/plugin/src/PluginComponent.vue b/core/core-frontend/src/components/plugin/src/PluginComponent.vue index 8232500f52..7ae6c0382b 100644 --- a/core/core-frontend/src/components/plugin/src/PluginComponent.vue +++ b/core/core-frontend/src/components/plugin/src/PluginComponent.vue @@ -110,7 +110,10 @@ onMounted(async () => { distributed = wsCache.get(key) } if (isNull(distributed)) { - emits('loadFail') + setTimeout(() => { + emits('loadFail') + loading.value = false + }, 1000) return } if (distributed) { diff --git a/core/core-frontend/src/components/plugin/src/index.vue b/core/core-frontend/src/components/plugin/src/index.vue index 9718f639b4..069bd72da3 100644 --- a/core/core-frontend/src/components/plugin/src/index.vue +++ b/core/core-frontend/src/components/plugin/src/index.vue @@ -98,11 +98,14 @@ const pluginProxy = ref(null) const invokeMethod = param => { if (pluginProxy.value['invokeMethod']) { pluginProxy.value['invokeMethod'](param) - } else { + } else if (param.methodName && pluginProxy.value[param.methodName]) { pluginProxy.value[param.methodName](param.args) } } - +const emits = defineEmits(['loadFail']) +defineExpose({ + invokeMethod +}) onMounted(async () => { const key = 'xpack-model-distributed' let distributed = false @@ -115,7 +118,10 @@ onMounted(async () => { distributed = wsCache.get(key) } if (isNull(distributed)) { - emits('loadFail') + setTimeout(() => { + emits('loadFail') + loading.value = false + }, 1000) return } if (distributed) { @@ -143,11 +149,6 @@ onMounted(async () => { loadComponent() } }) - -const emits = defineEmits(['loadFail']) -defineExpose({ - invokeMethod -})