Skip to content

Collapse 折叠面板

Display · Interactive component

Expandable information panels.

On-demand importwbbb-ui/components/collapse

Basic Usage

Example code
<script setup lang="ts">
import { ref } from 'vue'
import { WbbbCollapse } from 'wbbb-ui/components/collapse'
import 'wbbb-ui/styles/collapse'

const value = ref('')
</script>

<template>
  <WbbbCollapse v-model="value" />
</template>
Live mobile previewOpen in a new tab ↗

States and Interaction

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

Closed展开动效Disabled

API Reference

Props

PropertyDescriptionTypeDefaultRequired
accordionAllows only one collapse item to stay expanded at a time.booleanfalseNo
animatedEnables the component transition animation.booleantrueNo
itemsProvides the data items rendered by the component.WbbbCollapseItem[]() => []No
modelValueProvides the current value used by v-model.Array<string \| number> \| string \| number() => []No

Events

  • update:modelValue
  • change

Slots

  • default

Two-way binding

Supports v-model (modelValue).

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