mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
25 lines
503 B
Vue
25 lines
503 B
Vue
<script setup lang="ts">
|
|
const value = ref('')
|
|
const maxLength = 15
|
|
</script>
|
|
|
|
<template>
|
|
<UInput
|
|
v-model="value"
|
|
:maxlength="maxLength"
|
|
aria-describedby="character-count"
|
|
:ui="{ trailing: 'pointer-events-none' }"
|
|
>
|
|
<template #trailing>
|
|
<div
|
|
id="character-count"
|
|
class="text-xs text-muted tabular-nums"
|
|
aria-live="polite"
|
|
role="status"
|
|
>
|
|
{{ value?.length }}/{{ maxLength }}
|
|
</div>
|
|
</template>
|
|
</UInput>
|
|
</template>
|