feat(editor-core): async block support remove property

This commit is contained in:
lawvs
2022-07-27 15:56:29 +08:00
parent bea829efd6
commit 91781b4d75
2 changed files with 17 additions and 0 deletions

View File

@@ -143,8 +143,13 @@ export class EditorBlock extends ServiceBaseClass {
const decorations = db_block.getDecorations();
Object.entries(businessBlock.properties || {}).forEach(
([key, value]) => {
if (value === undefined) {
db_block.removeDecoration(key);
return;
}
if (decorations[key] !== value) {
db_block.setDecoration(key, value);
return;
}
}
);