Yt-UI
首页
快速开始
组件文档
首页
快速开始
组件文档
  • 表单组件

    • 输入框 Input
    • 多行输入框 Textarea
    • 开关 Switch
    • 多选框组 CheckboxGroup
    • 单选框组 RadioGroup
    • 滑块 Slider
    • 选择器 Picker
    • 日历 Calendar
    • 表单 Form
  • 展示组件

    • 头像 Avatar
    • 徽标 Badge
    • 卡片 Card
    • 标签 Tag
    • 步骤条 Steps
    • 结果页 Result
    • 空状态 Empty
    • 虚拟列表 VirtualList
  • 交互组件

    • 按钮 Button
    • 悬浮按钮 FAB
    • 图标 Icon
    • 搜索 Search
    • 分段器 Segment
    • 轮播 Swiper
    • 指示点 Dots
  • 反馈组件

    • 加载 Loading
    • 弹窗 Popup
    • 遮罩层 Overlay
    • 通告栏 NoticeBar
  • 导航组件

    • 标签栏 Tabbar
    • 顶部标签栏 TopTabbar
    • 折叠面板 Collapse
    • 课程表 Schedule
  • 布局组件

    • 分割线 Divider
    • 链接 Line
    • 可移动视图 MovableView

yt-segment 分段器组件

属性

属性名类型默认值说明
themeThemeColor'classic'主题颜色
sizeSizeType'medium'尺寸大小
liststring[][]分段选项列表
modelValuenumber0当前选中索引 (v-model)

主题颜色

<yt-segment theme="forest" :list="['选项1', '选项2']" />

<yt-segment theme="ocean" :list="['选项1', '选项2']" />

<yt-segment theme="magic" :list="['选项1', '选项2']" />

<yt-segment theme="blossom" :list="['选项1', '选项2']" />

<yt-segment theme="sunshine" :list="['选项1', '选项2']" />

<yt-segment theme="classic" :list="['选项1', '选项2']" />

<yt-segment theme="forest-sky" :list="['选项1', '选项2']" />

<yt-segment theme="ocean-sky" :list="['选项1', '选项2']" />

<yt-segment theme="magic-sky" :list="['选项1', '选项2']" />

<yt-segment theme="blossom-sky" :list="['选项1', '选项2']" />

<yt-segment theme="sunshine-sky" :list="['选项1', '选项2']" />

事件

事件名参数说明
update:modelValuemodelValue: numberv-model 更新
changeindex: number选项变化

示例

基本使用

<yt-segment :list="['选项1', '选项2']" />

绑定值

<yt-segment v-model="currentIndex" :list="['全部', '进行中', '已完成']" />

尺寸控制

<yt-segment size="large" :list="['大', '中', '小']" />

<yt-segment size="medium" :list="['选项1', '选项2']" />

<yt-segment size="small" :list="['A', 'B', 'C']" />

<yt-segment size="mini" :list="['是', '否']" />

事件处理

<yt-segment :list="['最新', '最热', '推荐']" @change="handleSegmentChange" />

多选项

<yt-segment :list="['全部', '待付款', '待发货', '待收货', '已完成']" />

完整示例

<yt-segment
  v-model="selectedIndex"
  theme="forest-sky"
  size="medium"
  :list="['日', '周', '月', '年']"
  @change="handleTimeChange"
/>
最近更新:: 2026/3/9 19:16
Contributors: CHEEMS, 2126340634
Prev
搜索 Search
Next
轮播 Swiper