zhangwencui
7 天以前 7619c19a67c2ac824f803090bab753fc5ea14408
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<script lang="ts" setup>
import { Slot } from 'reka-ui';
 
import { useFormField } from './useFormField';
 
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
</script>
 
<template>
  <Slot
    :id="formItemId"
    data-slot="form-control"
    :aria-describedby="
      !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`
    "
    :aria-invalid="!!error"
  >
    <slot></slot>
  </Slot>
</template>