perf: 优化事件编辑页面

This commit is contained in:
奔跑的面条
2022-10-16 16:27:15 +08:00
parent 284fdb8e05
commit 4f6757fff2
3 changed files with 137 additions and 88 deletions
+2 -3
View File
@@ -32,6 +32,7 @@ export const useLifeHandler = (chartConfig: CreateComponentType) => {
*/
function generateFunc(fnStr: string, e: any) {
try {
// npmPkgs 便于拷贝 echarts 示例时设置option 的formatter等相关内容
Function(`
"use strict";
return (
@@ -39,9 +40,7 @@ function generateFunc(fnStr: string, e: any) {
const {${Object.keys(npmPkgs).join()}} = node_modules;
${fnStr}
}
)`)().bind(e?.component)
// 便于拷贝echarts示例时设置option 的formatter等相关内容
e, components, npmPkgs
)`)().bind(e?.component)(e, components, npmPkgs)
} catch (error) {
console.error(error)
}