mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
feat(Modal/Slideover): add close method in slots (#4219)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -69,5 +69,13 @@ function openModal() {
|
||||
</UModal>
|
||||
|
||||
<UButton label="Open programmatically" color="neutral" variant="outline" @click="openModal" />
|
||||
|
||||
<UModal title="First modal">
|
||||
<UButton color="neutral" variant="outline" label="Close with scoped slot close" />
|
||||
|
||||
<template #footer="{ close }">
|
||||
<UButton label="Close with scoped slot close" @click="close" />
|
||||
</template>
|
||||
</UModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -125,5 +125,21 @@ function openSlideover() {
|
||||
</USlideover>
|
||||
|
||||
<UButton label="Open programmatically" color="neutral" variant="outline" @click="openSlideover" />
|
||||
|
||||
<USlideover title="Slideover with scoped slot close" description="This slideover has a scoped slot close that can be used to close the slideover from within the content.">
|
||||
<UButton color="neutral" variant="subtle" label="Open with scoped slot close" />
|
||||
|
||||
<template #header="{ close }">
|
||||
<UButton label="Close with scoped slot close" @click="close" />
|
||||
</template>
|
||||
|
||||
<template #body="{ close }">
|
||||
<UButton label="Close with scoped slot close" @click="close" />
|
||||
</template>
|
||||
|
||||
<template #footer="{ close }">
|
||||
<UButton label="Close with scoped slot close" @click="close" />
|
||||
</template>
|
||||
</USlideover>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user