0.0.2
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
<template>
|
||||
<!-- add:on-before-cancel -->
|
||||
<component
|
||||
:is="componentName"
|
||||
v-model:visible="dataVisible"
|
||||
:on-before-ok="submit"
|
||||
:on-before-cancel="beforeCancel"
|
||||
@cancel="close"
|
||||
ok-text="保存"
|
||||
cancel-text="关闭"
|
||||
@@ -46,7 +48,7 @@ const dataVisible = ref(false)
|
||||
const form = ref({})
|
||||
const actionTitle = ref("")
|
||||
const dataLoading = ref(true)
|
||||
const emit = defineEmits(["success", "error"])
|
||||
const emit = defineEmits(["success", "error", "beforeCancel"])
|
||||
|
||||
provide("form", toRaw(form))
|
||||
|
||||
@@ -134,6 +136,11 @@ const open = () => {
|
||||
dataVisible.value = true
|
||||
}
|
||||
}
|
||||
// ~~~~addMethod~~~~
|
||||
const beforeCancel = () => {
|
||||
emit("beforeCancel")
|
||||
return true
|
||||
}
|
||||
const close = () => {
|
||||
dataVisible.value = false
|
||||
formColumns.value = []
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
class="ma-crud-table-tr"
|
||||
:class="
|
||||
isFunction(options.rowCustomClass)
|
||||
? options.rowCustomClass(record, rowIndex) ?? []
|
||||
? (options.rowCustomClass(record, rowIndex) ?? [])
|
||||
: options.rowCustomClass
|
||||
"
|
||||
@contextmenu.prevent="openContextMenu($event, record)"
|
||||
@@ -215,7 +215,7 @@
|
||||
|
||||
<ma-setting ref="crudSettingRef" />
|
||||
|
||||
<ma-form ref="crudFormRef" @success="requestSuccess">
|
||||
<ma-form ref="crudFormRef" @success="requestSuccess" v-bind="$attrs">
|
||||
<template v-for="slot in Object.keys($slots)" #[slot]="component">
|
||||
<slot :name="slot" v-bind="component" />
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user