mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-18 22:11:43 +01:00
chore(Alert): rename close event to update:open for consistency
This commit is contained in:
@@ -110,7 +110,7 @@ props:
|
||||
Use the `close` prop to display a [Button](/components/button) to dismiss the Alert.
|
||||
|
||||
::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`.
|
||||
|
||||
@@ -46,7 +46,7 @@ export interface AlertProps {
|
||||
}
|
||||
|
||||
export interface AlertEmits {
|
||||
(e: 'close'): void
|
||||
(e: 'update:open', value: boolean): void
|
||||
}
|
||||
|
||||
export interface AlertSlots {
|
||||
@@ -122,7 +122,7 @@ const ui = computed(() => alert({
|
||||
aria-label="Close"
|
||||
v-bind="typeof close === 'object' ? close : undefined"
|
||||
:class="ui.close({ class: props.ui?.close })"
|
||||
@click="emits('close')"
|
||||
@click="emits('update:open', false)"
|
||||
/>
|
||||
</slot>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user