Skip to content

Field 表单项 ​

Form · Display component

Field labels and error messages.

On-demand importwbbb-ui/components/field

Basic Usage ​

Example code
<script setup lang="ts">
import { WbbbField } from 'wbbb-ui/components/field'
import 'wbbb-ui/styles/field'
</script>

<template>
  <WbbbField />
</template>
Live mobile previewOpen in a new tab ↗

States and Interaction ​

All listed states can be operated and verified in the live Playground preview.

DefaultFilledFocusDisabledError

API Reference ​

Props

PropertyDescriptionTypeDefaultRequired
labelSets the visible field or item label.string''No
labelWidthSets the width reserved for field labels.WbbbNumericundefinedNo
propAssociates the field with a key in the form model.string''No
requiredMarks the field as required for validation or display.booleanfalseNo
rulesProvides validation rules for the form or field.WbbbFormRule \| WbbbFormRule[]undefinedNo
valueProvides the displayed value or item value.unknownundefinedNo

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.

Wbbb UI · Built for uni-app product experiences