Skip to content

Commit

Permalink
feat(VConfirmEdit): expose save, cancel, isPristine
Browse files Browse the repository at this point in the history
closes #19747
  • Loading branch information
KaelWD committed May 16, 2024
1 parent 97ef8b3 commit 8ed8731
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/vuetify/src/components/VConfirmEdit/VConfirmEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import type { GenericProps } from '@/util'
export type VConfirmEditSlots<T> = {
default: {
model: Ref<T>
save: () => void
cancel: () => void
isPristine: boolean
get actions (): VNode
}
}
Expand Down Expand Up @@ -100,6 +103,9 @@ export const VConfirmEdit = genericComponent<new <T> (
{
slots.default?.({
model: internalModel,
save,
cancel,
isPristine: isPristine.value,
get actions () {
actionsUsed = true
return actions
Expand All @@ -111,6 +117,12 @@ export const VConfirmEdit = genericComponent<new <T> (
</>
)
})

return {
save,
cancel,
isPristine,
}
},
})

Expand Down

0 comments on commit 8ed8731

Please sign in to comment.