mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-24 18:26:17 +03:00
28 lines
551 B
Vue
28 lines
551 B
Vue
|
<script setup lang="ts">
|
||
|
import type { AriaLive } from '~/composables/aria/types'
|
||
|
import { useAriaStatus } from '~/composables/aria'
|
||
|
|
||
|
// tsc complaining when using $defineProps
|
||
|
withDefaults(defineProps<{
|
||
|
ariaLive?: AriaLive
|
||
|
}>(), {
|
||
|
ariaLive: 'polite',
|
||
|
})
|
||
|
|
||
|
const { announceStatus, clearStatus, status } = useAriaStatus()
|
||
|
|
||
|
defineExpose({
|
||
|
announceStatus,
|
||
|
clearStatus,
|
||
|
})
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<slot />
|
||
|
<p sr-only role="status" :aria-live="ariaLive">
|
||
|
<slot name="status" :status="status">
|
||
|
{{ status }}
|
||
|
</slot>
|
||
|
</p>
|
||
|
</template>
|