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