mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
fix(useOverlay)!: correct spelling of unmount function (#4051)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -62,7 +62,7 @@ Update an overlay using its `id`
|
|||||||
- `id`: The identifier of the overlay
|
- `id`: The identifier of the overlay
|
||||||
- `props`: An object of props to update on the rendered component.
|
- `props`: An object of props to update on the rendered component.
|
||||||
|
|
||||||
### `unMount(id: symbol): void`
|
### `unmount(id: symbol): void`
|
||||||
|
|
||||||
Removes the overlay from the DOM using its `id`
|
Removes the overlay from the DOM using its `id`
|
||||||
|
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { useOverlay, type Overlay } from '../composables/useOverlay'
|
import { useOverlay, type Overlay } from '../composables/useOverlay'
|
||||||
|
|
||||||
const { overlays, unMount, close } = useOverlay()
|
const { overlays, unmount, close } = useOverlay()
|
||||||
|
|
||||||
const mountedOverlays = computed(() => overlays.filter((overlay: Overlay) => overlay.isMounted))
|
const mountedOverlays = computed(() => overlays.filter((overlay: Overlay) => overlay.isMounted))
|
||||||
|
|
||||||
const onAfterLeave = (id: symbol) => {
|
const onAfterLeave = (id: symbol) => {
|
||||||
close(id)
|
close(id)
|
||||||
unMount(id)
|
unmount(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onClose = (id: symbol, value: any) => {
|
const onClose = (id: symbol, value: any) => {
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ function _useOverlay() {
|
|||||||
overlays.forEach(overlay => close(overlay.id))
|
overlays.forEach(overlay => close(overlay.id))
|
||||||
}
|
}
|
||||||
|
|
||||||
const unMount = (id: symbol): void => {
|
const unmount = (id: symbol): void => {
|
||||||
const overlay = getOverlay(id)
|
const overlay = getOverlay(id)
|
||||||
|
|
||||||
overlay.isMounted = false
|
overlay.isMounted = false
|
||||||
@@ -135,7 +135,7 @@ function _useOverlay() {
|
|||||||
closeAll,
|
closeAll,
|
||||||
create,
|
create,
|
||||||
patch,
|
patch,
|
||||||
unMount,
|
unmount,
|
||||||
isOpen
|
isOpen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user