mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 10:08:34 +00:00
feat: @idraw/core addElement return uuid
This commit is contained in:
parent
50c4bc1b96
commit
ae5cc67127
2 changed files with 4 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# @idraw/core
|
||||
|
||||
* [] Area select
|
||||
* [] Hover element style
|
||||
* [] Keep all num two decimals
|
||||
* [x] Cursor style
|
||||
* [x] Can't controll element at scroll-area
|
||||
|
|
|
|||
|
|
@ -203,13 +203,14 @@ class Core {
|
|||
this.draw();
|
||||
}
|
||||
|
||||
addElement(elem: TypeElement<keyof TypeElemDesc>) {
|
||||
if (this[_onlyRender] === true) return;
|
||||
addElement(elem: TypeElement<keyof TypeElemDesc>): string | null {
|
||||
if (this[_onlyRender] === true) return null;
|
||||
const _elem = deepClone(elem);
|
||||
_elem.uuid = createUUID();
|
||||
this[_data].elements.unshift(_elem);
|
||||
this[_emitChangeData]();
|
||||
this.draw();
|
||||
return _elem.uuid;
|
||||
}
|
||||
|
||||
deleteElement(uuid: string) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue