Skip to content

Commit

Permalink
perf(baTable):添加表单默认值改为深拷贝
Browse files Browse the repository at this point in the history
  • Loading branch information
build-admin committed May 17, 2023
1 parent 5cf0fc9 commit 7632ac7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/utils/baTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Sortable from 'sortablejs'
import { findIndexRow } from '/@/components/table'
import { ElNotification, ElForm } from 'element-plus'
import { onBeforeRouteUpdate, useRoute } from 'vue-router'
import { isUndefined } from 'lodash-es'
import { cloneDeep, isUndefined } from 'lodash-es'
import { i18n } from '/@/lang/index'
import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'

Expand Down Expand Up @@ -171,7 +171,7 @@ export default class baTable {
}
this.requestEdit(operateIds[0])
} else if (operate == 'add') {
this.form.items = Object.assign({}, this.form.defaultItems)
this.form.items = cloneDeep(this.form.defaultItems)
}
this.form.operate = operate
this.form.operateIds = operateIds
Expand Down

0 comments on commit 7632ac7

Please sign in to comment.