Skip to content

Commit

Permalink
feat: add close function to defineSlots
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterliu1003 committed Dec 7, 2023
1 parent 7cbe72d commit e6ed697
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 482 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defineOptions({ inheritAttrs: false })
const instance = getCurrentInstance()
defineSlots<{
'default'(): void
'default'(props: { close: () => boolean }): void
'swipe-banner'(): void
}>()
Expand Down Expand Up @@ -223,7 +223,7 @@ defineExpose({
v-bind="bindSwipe"
@mousedown="() => onMousedown()"
>
<slot />
<slot v-bind="{ close }" />

<div
v-if="showSwipeBanner"
Expand Down
Loading

0 comments on commit e6ed697

Please sign in to comment.