mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-29 19:30:37 +01:00
11
docs/components/content/examples/PopoverExampleSlot.vue
Normal file
11
docs/components/content/examples/PopoverExampleSlot.vue
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<template>
|
||||||
|
<UPopover>
|
||||||
|
<UButton color="white" label="Open" trailing-icon="i-heroicons-chevron-down-20-solid" />
|
||||||
|
|
||||||
|
<template #panel="{ close }">
|
||||||
|
<div class="p-8">
|
||||||
|
<UButton label="Close" @click="close" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</UPopover>
|
||||||
|
</template>
|
||||||
@@ -14,6 +14,7 @@ links:
|
|||||||
::component-example
|
::component-example
|
||||||
#default
|
#default
|
||||||
:popover-example
|
:popover-example
|
||||||
|
|
||||||
#code
|
#code
|
||||||
```vue
|
```vue
|
||||||
<template>
|
<template>
|
||||||
@@ -53,7 +54,27 @@ Use the `mode` prop to switch between `click` and `hover` modes.
|
|||||||
|
|
||||||
### `panel`
|
### `panel`
|
||||||
|
|
||||||
Use the `#panel` slot to fill the content of the panel.
|
Use the `#panel` slot to fill the content of the panel. You will have access to the `open` property and the `close` method in the slot scope.
|
||||||
|
|
||||||
|
::component-example
|
||||||
|
#default
|
||||||
|
:popover-example-slot
|
||||||
|
|
||||||
|
#code
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<UPopover>
|
||||||
|
<UButton color="white" label="Open" trailing-icon="i-heroicons-chevron-down-20-solid" />
|
||||||
|
|
||||||
|
<template #panel="{ close }">
|
||||||
|
<div class="p-8">
|
||||||
|
<UButton label="Close" @click="close" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</UPopover>
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
::
|
||||||
|
|
||||||
## Props
|
## Props
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user