This commit is contained in:
jxxghp
2024-04-25 16:06:47 +08:00
parent 5895cea587
commit 5f3ba7b9c7
+5 -5
View File
@@ -49,8 +49,9 @@ async function commonAction(api_path: string, method: string, params = {}) {
}
// 组装事件
let componentEvents: { [key: string]: any } = {}
if (!isNullOrEmptyObject(elementProps.config?.events)) {
let componentEvents = reactive<{ [key: string]: any }>({})
watchEffect(() => {
if (!isNullOrEmptyObject(elementProps.config?.events)) {
for (const key in elementProps.config?.events) {
const attr = elementProps.config?.events[key]
const func = async () => {
@@ -58,9 +59,8 @@ if (!isNullOrEmptyObject(elementProps.config?.events)) {
}
componentEvents[key] = func
}
} else {
componentEvents = {}
}
}
})
</script>
<template>