chore(Alert): rename close event to update:open for consistency

This commit is contained in:
Benjamin Canac
2024-09-18 17:31:42 +02:00
parent 500b4727e8
commit a70ba04fc3
2 changed files with 3 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ props:
Use the `close` prop to display a [Button](/components/button) to dismiss the Alert. Use the `close` prop to display a [Button](/components/button) to dismiss the Alert.
::tip ::tip
A `close` event will be emitted when the close button is clicked. An `update:open` event will be emitted when the close button is clicked.
:: ::
Use the `close-icon` prop to customize the button [Icon](/components/icon). Defaults to `i-heroicons-x-mark-20-solid`. Use the `close-icon` prop to customize the button [Icon](/components/icon). Defaults to `i-heroicons-x-mark-20-solid`.

View File

@@ -46,7 +46,7 @@ export interface AlertProps {
} }
export interface AlertEmits { export interface AlertEmits {
(e: 'close'): void (e: 'update:open', value: boolean): void
} }
export interface AlertSlots { export interface AlertSlots {
@@ -122,7 +122,7 @@ const ui = computed(() => alert({
aria-label="Close" aria-label="Close"
v-bind="typeof close === 'object' ? close : undefined" v-bind="typeof close === 'object' ? close : undefined"
:class="ui.close({ class: props.ui?.close })" :class="ui.close({ class: props.ui?.close })"
@click="emits('close')" @click="emits('update:open', false)"
/> />
</slot> </slot>
</div> </div>