Skip to content

Commit

Permalink
Merge pull request #209 from fankiewing/main
Browse files Browse the repository at this point in the history
fix: 修复MaCrud组件beforeOpenEdit函数BUG
  • Loading branch information
kanyxmo authored Nov 8, 2024
2 parents 5e4620c + 4cbaf37 commit 09b82b7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/ma-crud/components/column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,17 @@ const seeAction = record => {
}
}
const editAction = record => {
if (isFunction(options.beforeOpenEdit) && ! options.beforeOpenEdit(record)) {
return false
const editAction = (async (record) => {
if (isFunction(options.beforeOpenEdit)) {
const isOpen = await options.beforeOpenEdit(record)
if (!isOpen) return false;
}
if (options.edit.action && isFunction(options.edit.action)) {
options.edit.action(record)
} else {
props.crudFormRef.edit(record)
}
}
})
const allowQuickEdit = (formType) => ['select', 'input', 'input-number', 'radio'].includes(formType ?? 'input')
Expand Down Expand Up @@ -330,4 +331,4 @@ defineExpose({ deleteAction, recoveryAction })
object-fit: contain;
background-color: var(--color-fill-4);
}
</style>
</style>

0 comments on commit 09b82b7

Please sign in to comment.