Skip to content

Commit

Permalink
fix: 修改变量名
Browse files Browse the repository at this point in the history
  • Loading branch information
gene9831 committed Apr 8, 2024
1 parent 6e175df commit a2290ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions packages/canvas/src/components/container/CanvasAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<div v-show="hoverState.configure?.isContainer" class="corner-mark-bottom-right">拖放元素到容器内</div>
</div>
<div v-show="lineState.height && lineState.width" class="canvas-rect line">
<div :class="['hover-line', lineState.position, { forbid: lineState.forbid }]">
<div :class="['hover-line', lineState.position, { forbidden: lineState.forbidden }]">
<div v-if="lineState.position === 'in' && hoverState.configure" class="choose-slots"></div>
</div>
</div>
Expand Down Expand Up @@ -540,10 +540,10 @@ export default {
height: 100%;
background: var(--ti-lowcode-canvas-hover-line-in-bg-color);
}
&.forbid:not(.in) {
&.forbidden:not(.in) {
background: var(--ti-lowcode-canvas-hover-line-forbid-bg-color);
}
&.forbid.in {
&.forbidden.in {
background: var(--ti-lowcode-canvas-hover-line-in-forbid-bg-color);
}
}
Expand Down
18 changes: 9 additions & 9 deletions packages/canvas/src/components/container/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const initialLineState = {
width: 0,
left: 0,
position: '',
forbid: false,
forbidden: false,
id: '',
config: null,
doc: null
Expand Down Expand Up @@ -440,7 +440,7 @@ const getPosLine = (rect, configure) => {
const yAbs = Math.min(lineAbs, rect.height / 3)
const xAbs = Math.min(lineAbs, rect.width / 3)
let type
let forbid = false
let forbidden = false

if (mousePos.y < rect.top + yAbs) {
type = POSITION.TOP
Expand All @@ -453,7 +453,7 @@ const getPosLine = (rect, configure) => {
} else if (configure.isContainer) {
type = POSITION.IN
if (!allowInsert()) {
forbid = true
forbidden = true
}
} else {
type = POSITION.BOTTOM
Expand All @@ -462,10 +462,10 @@ const getPosLine = (rect, configure) => {
// 如果被拖拽的节点不是新增的,并且是放置的节点的祖先节点,则禁止插入
const draggedId = dragState.data?.id
if (draggedId && isAncestor(draggedId, lineState.id)) {
forbid = true
forbidden = true
}

return { type, forbid }
return { type, forbidden }
}

const isBodyEl = (element) => element.nodeName === 'BODY'
Expand Down Expand Up @@ -518,7 +518,7 @@ const setHoverRect = (element, data) => {
top: top * scale + y - siteCanvasRect.y,
left: left * scale + x - siteCanvasRect.x,
position: canvasState.type === 'absolute' || posLine.type,
forbid: posLine.forbid
forbidden: posLine.forbidden
})
} else {
const posLine = getPosLine(rect, configure)
Expand All @@ -528,7 +528,7 @@ const setHoverRect = (element, data) => {
top: top * scale + y - siteCanvasRect.y,
left: left * scale + x - siteCanvasRect.x,
position: canvasState.type === 'absolute' || posLine.type,
forbid: posLine.forbid
forbidden: posLine.forbidden
})
}

Expand Down Expand Up @@ -701,12 +701,12 @@ export const copyNode = (id) => {

export const onMouseUp = () => {
const { draging, data } = dragState
const { position, forbid } = lineState
const { position, forbidden } = lineState
const absolute = canvasState.type === 'absolute'
const sourceId = data?.id
const lineId = lineState.id

if (draging && !forbid) {
if (draging && !forbidden) {
const { parent, node } = getNode(lineId, true) || {} // target
const targetNode = { parent, node, data: toRaw(data) }

Expand Down

0 comments on commit a2290ff

Please sign in to comment.