mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-01 20:57:57 +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.
|
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`.
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user