Skip to content

Commit

Permalink
perf: free-layout UI (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx authored Aug 13, 2021
1 parent e6092ee commit 238ab65
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ $baseZIndexInFreeLayout: 10;
bottom: 0;
left: 0;
z-index: -1;
background: #fd9c9c;
background: #F3F8FF;
& > * {
display: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
if (originalTop + componentHeight > containerBottom) {
top = containerBottom - containerTop - componentHeight
} else {
top = originalTop - containerTop
top = originalTop - containerTop - 15
}
}
// left 位置计算
Expand All @@ -404,12 +404,12 @@
if (originalLeft + componentWidth > containerRight) {
left = containerRight - containerLeft - componentWidth
} else {
left = originalLeft - containerLeft
left = originalLeft - containerLeft - 15
}
}
const stylePosition = {
top: `${Math.max(top, 0)}px`,
left: `${Math.max(left, 0)}px`
top: `${Math.max(top, 10)}px`,
left: `${Math.max(left, 10)}px`
}
// 需要 emit 一次,因为刚拖入到自由布局中的组件还没有拖动,不会触发 end 事件
Expand Down
4 changes: 2 additions & 2 deletions paas-ce/lesscode/lib/client/src/views/index/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,12 @@ $headerHeight: 64px;

/* in-column-drag-area, Class name for the drop placeholder */
/* 从左侧往中间拖拽区拖拽时生效 */
.target-ghost,
.in-column-ghost {
opacity: .5;
&.component-item {
&:after {
content: "放在这里";
background-color: #fd9c9c;
background-color: #F3F8FF;
position: absolute;
left: 0;
text-align: center;
Expand Down

0 comments on commit 238ab65

Please sign in to comment.