Files
heroui-vue/apps/docs/demos/textfield-controlled.vue
T

29 lines
703 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { ref } from "vue";
import {
Description,
Input,
Label,
TextArea,
TextField,
} from "@heroui-vue/components";
const name = ref("");
const bio = ref("");
</script>
<template>
<div class="flex w-full max-w-64 flex-col gap-4">
<TextField v-model="name" name="name">
<Label>显示名称</Label>
<Input placeholder="Jane" />
<Description>字符数: {{ name.length }}</Description>
</TextField>
<TextField v-model="bio" name="bio">
<Label>个人简介</Label>
<TextArea placeholder="介绍一下你自己…" />
<Description>字符数: {{ bio.length }} / 200</Description>
</TextField>
</div>
</template>