Skip to content

Commit

Permalink
fix: 使用默认组件数据需要深拷贝,防止撤销出问题 #124
Browse files Browse the repository at this point in the history
  • Loading branch information
tanguangzhi authored and woai3c committed Aug 11, 2023
1 parent 32261b0 commit 75bf7fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/store/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { deepCopy } from '@/utils/utils'
// 设置画布默认数据 https://github.com/woai3c/visual-drag-demo/issues/92
let defaultcomponentData = []
function getDefaultcomponentData() {
return defaultcomponentData
return JSON.parse(JSON.stringify(defaultcomponentData))
}

export function setDefaultcomponentData(data = []) {
Expand Down
1 change: 1 addition & 0 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export default {
width: 288px;
right: 0;
top: 0;
.el-select {
width: 100%;
}
Expand Down

0 comments on commit 75bf7fe

Please sign in to comment.