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-button 按钮组件

属性

属性名类型默认值说明
themeThemeColor'classic'主题颜色
typeColorType'primary'按钮类型
sizeSizeType'medium'按钮尺寸
plainbooleanfalse是否朴素样式
disabledbooleanfalse是否禁用
loadingbooleanfalse是否加载中
circlebooleanfalse是否圆形按钮
stretchbooleanfalse是否拉伸宽度

事件

事件名参数说明
clicke: Event点击按钮

示例

基本按钮

<yt-button>按钮</yt-button>
<yt-button theme="forest">森林绿</yt-button>
<yt-button theme="ocean">海洋蓝</yt-button>
<yt-button theme="magic">魔法紫</yt-button>
<yt-button theme="blossom">樱花粉</yt-button>
<yt-button theme="sunshine">阳光橙</yt-button>
<yt-button theme="classic">经典白</yt-button>
<yt-button theme="forest-sky">森林星空</yt-button>
<yt-button theme="ocean-sky">海洋星空</yt-button>
<yt-button theme="magic-sky">魔法星空</yt-button>
<yt-button theme="blossom-sky">樱花星空</yt-button>
<yt-button theme="sunshine-sky">阳光星空</yt-button>

按钮类型

<yt-button type="primary" theme="forest">主要按钮</yt-button>
<yt-button type="success" theme="forest">成功按钮</yt-button>
<yt-button type="warning" theme="forest">警告按钮</yt-button>
<yt-button type="danger" theme="forest">危险按钮</yt-button>
<yt-button type="info" theme="forest">信息按钮</yt-button>

按钮尺寸

<yt-button size="large" theme="ocean">大按钮</yt-button>
<yt-button size="medium" theme="ocean">中按钮</yt-button>
<yt-button size="small" theme="ocean">小按钮</yt-button>
<yt-button size="mini" theme="ocean">迷你按钮</yt-button>

朴素样式

<yt-button plain theme="magic">朴素按钮</yt-button>
<yt-button :plain="true" theme="blossom">朴素樱花粉</yt-button>
<yt-button :plain="true" theme="sunshine">朴素阳光橙</yt-button>

禁用状态

<yt-button disabled theme="classic">禁用按钮</yt-button>
<yt-button :disabled="true" theme="forest-sky">禁用星空</yt-button>
<yt-button disabled plain theme="ocean-sky">禁用朴素海洋星空</yt-button>

加载状态

<yt-button loading theme="magic-sky">加载中</yt-button>
<yt-button :loading="true" theme="blossom-sky">加载中按钮</yt-button>
<yt-button loading disabled theme="sunshine-sky">加载中禁用</yt-button>

圆形按钮

<yt-button circle theme="forest">圆形</yt-button>
<yt-button :circle="true" size="small" theme="ocean">小圆形</yt-button>
<yt-button circle plain theme="magic">朴素圆形</yt-button>
<yt-button circle loading theme="blossom">加载圆形</yt-button>

拉伸宽度

<yt-button stretch theme="sunshine">拉伸按钮</yt-button>
<yt-button :stretch="true" theme="classic">全宽按钮</yt-button>
<yt-button stretch plain theme="forest-sky">拉伸朴素星空</yt-button>
<yt-button stretch loading theme="ocean-sky">拉伸加载中</yt-button>

组合使用

<yt-button
  theme="forest-sky"
  type="primary"
  size="large"
  :plain="false"
  :disabled="false"
  :loading="false"
  :circle="false"
  :stretch="true"
  @click="handleClick"
>
  星空主题按钮
</yt-button>
最近更新:: 2026/3/9 19:16
Contributors: CHEEMS, 2126340634
Next
悬浮按钮 FAB