feat:优化渲染性能

This commit is contained in:
黄云飞
2021-11-23 21:45:01 +08:00
parent 0f8f228137
commit c7b8832789
6 changed files with 155 additions and 43 deletions
+6 -3
View File
@@ -47,12 +47,15 @@ export default class Editor {
value: ZERO
})
}
elementList.forEach(el => {
for (let i = 0; i < elementList.length; i++) {
const el = elementList[i]
if (el.value === '\n') {
el.value = ZERO
}
el.id = getUUID()
})
if (el.type === ElementType.IMAGE) {
el.id = getUUID()
}
}
// 监听
this.listener = new Listener()
// 启动