removeField func for editor
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { ZeroEditorField } from "zero/schemas";
|
||||
import { ZeroEditorFieldImpl, ZeroEditorFieldConfiguration, createFieldProxy } from "./editor-field";
|
||||
import { arrayRemove } from '../utils';
|
||||
|
||||
|
||||
export class ZeroEditorCanvasBase
|
||||
@@ -26,6 +27,16 @@ export class ZeroEditorCanvasBase
|
||||
{
|
||||
return this.fields.find(x => x.path == path);
|
||||
}
|
||||
|
||||
removeField(path: string): void
|
||||
{
|
||||
let field = this.getField(path);
|
||||
|
||||
if (field)
|
||||
{
|
||||
arrayRemove(this.fields, field);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user