feat(layout): 布局容器新增前后插入容器元素icon

Change-Id: I6ef8512f2a809088321a31799e31672a496f34de
This commit is contained in:
wibetter 2022-07-05 14:34:27 +08:00
parent 1af75b00b4
commit 7cd294a0ed
2 changed files with 8 additions and 4 deletions

View File

@ -587,7 +587,7 @@
width: 20px;
height: 20px;
line-height: 20px;
border-radius: 500px;
border-radius: 20px;
top: 20%;
> span > svg {

View File

@ -837,7 +837,11 @@ export class EditorManager {
* &
* @param rendererSchema
*/
async appendSiblingSchema(rendererSchema: Object) {
async appendSiblingSchema(
rendererSchema: Object,
beforeInsert?: boolean,
disabledAutoSelectInsertElem?: boolean
) {
if (!rendererSchema) {
return;
}
@ -881,7 +885,7 @@ export class EditorManager {
}
return result;
});
nextId = parent[beforeId + 1]?.$$id; // 下一个节点的ID追加时需要
nextId = parent[beforeInsert ? beforeId : beforeId + 1]?.$$id; // 下一个节点的ID追加时需要
const child = this.addChild(
regionNodeId,
@ -889,7 +893,7 @@ export class EditorManager {
rendererSchema,
nextId
);
if (child) {
if (child && !disabledAutoSelectInsertElem) {
// mobx 修改数据是异步的
setTimeout(() => {
store.setActiveId(child.$$id);