Field 表单项
Form · Display component
Field labels and error messages.
On-demand import
wbbb-ui/components/fieldBasic Usage
<script setup lang="ts">
import { WbbbField } from 'wbbb-ui/components/field'
import 'wbbb-ui/styles/field'
</script>
<template>
<WbbbField />
</template>States and Interaction
All listed states can be operated and verified in the live Playground preview.
DefaultFilledFocusDisabledError
API Reference
Props
| Property | Description | Type | Default | Required |
|---|---|---|---|---|
label | Sets the visible field or item label. | string | '' | No |
labelWidth | Sets the width reserved for field labels. | WbbbNumeric | undefined | No |
prop | Associates the field with a key in the form model. | string | '' | No |
required | Marks the field as required for validation or display. | boolean | false | No |
rules | Provides validation rules for the form or field. | WbbbFormRule \| WbbbFormRule[] | undefined | No |
value | Provides the displayed value or item value. | unknown | undefined | No |
Events
None
Slots
default
Two-way binding
Does not support v-model.
Platform Notes
Build verification: H5, App Vue, WeChat Mini Program, Alipay Mini Program, and Douyin Mini Program.
Runtime differences: H5 supports keyboard focus and reduced motion. Mini Programs provide equivalent touch interaction; verify upload, date selection, and overlays on target platforms.
Usage note: Use Playground to verify further state combinations and cross-platform behavior.
