分段开关Segmented Control SegmentedControl
2–4 个互斥选项,选中项以滑块平移2-4 mutually exclusive options with a sliding thumb
实时示例Live example
活体样例,可直接交互(点开浮层 / 下拉 / 试试键盘)——与组件画廊同源,切主题会同步。Interactive sample straight from the gallery (open overlays, dropdowns, try the keyboard); the theme stays in sync. 新标签打开 ↗Open in new tab ↗ · 看完整画廊Full gallery
PropsProps2
| 名称Name | 类型Type | 必填Required | 默认值Default | 说明Notes |
|---|---|---|---|---|
modelValue |
string |
是yes | — | |
options |
FieldOption[] |
是yes | — |
EventsEvents1
update:modelValue— v: string
Class 契约Class contract
照抄以下类名,不要自造——它们是本设计系统的唯一命名空间(anx- 前缀)。Copy these class names as-is — they are the system’s only namespace (anx- prefix).
anx-segmented anx-segmented__opt anx-segmented__thumb
无障碍Accessibility
- 分段/开关选中态用 aria-pressed
依赖Dependencies
ui.types
源码Source
vue/ui/SegmentedControl.vue
在 GitHub 上查看View on GitHub ↗