feat: complete field documentation and TextArea examples
This commit is contained in:
@@ -3,13 +3,17 @@ import { useAttrs } from "vue";
|
||||
import { textAreaVariants, type TextAreaVariants } from "@heroui-vue/styles";
|
||||
import { useTextControl } from "../field/useTextControl";
|
||||
defineOptions({ inheritAttrs: false });
|
||||
const props = defineProps<{
|
||||
modelValue?: string;
|
||||
defaultValue?: string;
|
||||
invalid?: boolean;
|
||||
variant?: TextAreaVariants["variant"];
|
||||
fullWidth?: boolean;
|
||||
}>();
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
modelValue?: string;
|
||||
defaultValue?: string;
|
||||
invalid?: boolean;
|
||||
variant?: TextAreaVariants["variant"];
|
||||
fullWidth?: boolean;
|
||||
rows?: number;
|
||||
}>(),
|
||||
{ rows: 3 },
|
||||
);
|
||||
const emit = defineEmits<{ "update:modelValue": [value: string] }>();
|
||||
const attrs = useAttrs();
|
||||
const control = useTextControl(props, attrs, emit);
|
||||
@@ -23,6 +27,7 @@ defineExpose({ focus: () => element.value?.focus(), element });
|
||||
:value="value"
|
||||
:id="control.id()"
|
||||
:name="control.name()"
|
||||
:rows="rows"
|
||||
:disabled="control.disabled()"
|
||||
:readonly="control.readOnly()"
|
||||
:required="control.required()"
|
||||
|
||||
Reference in New Issue
Block a user