mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 11:07:52 +08:00
feat(layout): 列级容器增加左右插入功能icon
Change-Id: I8f96f44685ebc750e92cdf1c5428b9fcad8c7397
This commit is contained in:
parent
f8333e2308
commit
bf0856687d
@ -588,7 +588,8 @@
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
top: 20%;
|
top: 50%;
|
||||||
|
transform: translate(0, -50%);
|
||||||
|
|
||||||
> span > svg {
|
> span > svg {
|
||||||
width: 12px;
|
width: 12px;
|
||||||
|
@ -869,6 +869,9 @@ export class EditorManager {
|
|||||||
if (!regionNode.region && regionNode.schema.body) {
|
if (!regionNode.region && regionNode.schema.body) {
|
||||||
// 默认插入到父节点的body中
|
// 默认插入到父节点的body中
|
||||||
regionNodeRegion = 'body';
|
regionNodeRegion = 'body';
|
||||||
|
} else if (!regionNode.region && regionNode.schema?.type === 'flex' && regionNode.schema.items) {
|
||||||
|
// flex布局容器
|
||||||
|
regionNodeRegion = 'items';
|
||||||
} else if (!regionNode.region && !regionNode.schema.body) {
|
} else if (!regionNode.region && !regionNode.schema.body) {
|
||||||
// 其他特殊情况暂时不考虑,给予提示
|
// 其他特殊情况暂时不考虑,给予提示
|
||||||
toast.warning('当前节点不允许追加新组件。');
|
toast.warning('当前节点不允许追加新组件。');
|
||||||
|
@ -852,6 +852,7 @@ export const EditorStore = types
|
|||||||
return idx < self.schemaHistory.length - 1;
|
return idx < self.schemaHistory.length - 1;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 判断是否时布局容器中的列级元素
|
||||||
isFlexItem(id: string) {
|
isFlexItem(id: string) {
|
||||||
const activeId = id || self.activeId;
|
const activeId = id || self.activeId;
|
||||||
const parentSchema = this.getSchemaParentById(activeId, true);
|
const parentSchema = this.getSchemaParentById(activeId, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user