Skip to content

Commit

Permalink
fix: canvasDivider can't work
Browse files Browse the repository at this point in the history
1. 修复 CanvasRowCol 组件剪刀工具无效的 bug
  • Loading branch information
chilingling committed Jan 25, 2025
1 parent 5b9d61a commit 64b9f34
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/canvas/container/src/components/CanvasDivider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

<script>
import { reactive, watch } from 'vue'
import { useCanvas } from '@opentiny/tiny-engine-meta-register'
import { extend } from '@opentiny/vue-renderless/common/object'
import { getCurrent, updateRect } from '../container'
Expand Down Expand Up @@ -86,6 +87,12 @@ export default {
const index = parent.children.findIndex(({ id }) => id === schema.id)
parent.children.splice(index + 1, 0, extend(true, {}, COL_SNIPPET))
useCanvas().operateNode({
type: 'updateAttributes',
id: parent.id,
value: { children: parent.children }
})
updateRect()
}
Expand All @@ -97,6 +104,12 @@ export default {
if (schema.componentName === 'CanvasRow') {
parent.children.splice(index + 1, 0, extend(true, {}, ROW_SNIPPET))
useCanvas().operateNode({
type: 'updateAttributes',
id: parent.id,
value: { children: parent.children }
})
return
}
Expand All @@ -123,6 +136,12 @@ export default {
// 已经切割过了,直接加一行
schema.children.push(extend(true, {}, ROW_SNIPPET))
}
useCanvas().operateNode({
type: 'updateAttributes',
id: parent.id,
value: { children: parent.children }
})
}
updateRect()
Expand Down

0 comments on commit 64b9f34

Please sign in to comment.