MyUI按钮VcButton 组件文档

VcButton 组件文档

简介

VcButton 是一个高度可定制的按钮组件,支持多种样式、尺寸和状态。

基本用法

html

复制代码
<vc-button type="primary">主要按钮</vc-button>

属性

属性名 类型 默认值 说明
type String 'primary' 按钮类型,可选值见下方类型表
size String 'md' 按钮尺寸,可选'sm', 'md', 'lg'
icon String - 图标类名
iconPosition String 'left' 图标位置,'left'或'right'
block Boolean false 是否块级按钮
disabled Boolean false 是否禁用
rounded Boolean false 是否圆角
loading Boolean false 是否加载中

按钮类型

基础类型

html

复制代码
<vc-button type="primary">主要</vc-button>
<vc-button type="secondary">次要</vc-button>
<vc-button type="success">成功</vc-button>
<vc-button type="danger">危险</vc-button>
<vc-button type="warning">警告</vc-button>
<vc-button type="info">信息</vc-button>
<vc-button type="light">浅色</vc-button>
<vc-button type="dark">深色</vc-button>

Material Design 风格

html

复制代码
<vc-button type="material-primary">Material 主要</vc-button>
<vc-button type="material-success">Material 成功</vc-button>

Neon 霓虹风格

html

复制代码
<vc-button type="neon-blue">Neon 蓝色</vc-button>
<vc-button type="neon-pink">Neon 粉色</vc-button>

Glow 发光风格

html

复制代码
<vc-button type="glow-primary">Glow 主要</vc-button>
<vc-button type="glow-success">Glow 成功</vc-button>

Float 浮动风格

html

复制代码
<vc-button type="float-primary">Float 主要</vc-button>
<vc-button type="float-purple">Float 紫色</vc-button>

Minimal 极简风格

html

复制代码
<vc-button type="minimal-primary">Minimal 主要</vc-button>
<vc-button type="minimal-dark">Minimal 深色</vc-button>

3D 风格

html

复制代码
<vc-button type="3d-primary">3D 主要</vc-button>
<vc-button type="3d-danger">3D 危险</vc-button>

Gradient 渐变风格

html

复制代码
<vc-button type="gradient-primary">渐变 主要</vc-button>
<vc-button type="gradient-success">渐变 成功</vc-button>

事件

事件名 说明 回调参数
click 点击事件 MouseEvent

插槽

名称 说明
default 按钮内容

示例

vue页面

复制代码
<vc-button type="3d-primary" class="mr-2">开始使用</vc-button>
<vc-button type="minimal-primary" class="mr-2">查看演示</vc-button>

js

复制代码
import VcButton from '@/components/Button/Button.vue';
export default {
  name: 'HomePage',
  components: {
    VcButton
  },

鼠标悬停点击动画

复制代码
<vc-button type="primary" icon="fas fa-check" icon-position="right">
  提交
</vc-button>

<vc-button type="danger" size="lg" :loading="true">
  删除
</vc-button>

<vc-button type="gradient-primary" rounded>
  渐变按钮
</vc-button>

<vc-button type="neon-blue" block>
  全宽霓虹按钮
</vc-button>
相关推荐
Json____几秒前
java-宿舍安全卫生检查系统项目源码
java·前端·javascript·课程设计·it学习·wwwoop.com
zzzll111114 分钟前
LangChain4j:Java 生态的 AI 应用开发利器
java·开发语言·人工智能
爱勇宝22 分钟前
公司没给活干,却因为员工看手机把人开了:法院判赔11万元
前端·后端·程序员
Patrick_Wilson23 分钟前
iOS Safari 按钮点击无响应问题修复指南
前端·ios·safari
Csvn31 分钟前
模块化与工程化:CJS / ESM / 打包器,到底怎么协作?
前端
2601_9673387134 分钟前
尚硅谷2026尚硅谷Java全栈+Python智能体教程
java·人工智能
hunterandroid43 分钟前
[鸿蒙从零到一] ArkTS Sendable 数据模型与跨线程共享实战
前端
AICoder码农王1 小时前
Vitest 实战:从一个真实项目看懂测试套件
前端·前端框架
孙克旭_1 小时前
单链表进阶实操:5 道常考面试题详细解析【Java 实现】
java·开发语言·数据结构·单链表
Titan20241 小时前
HTTPS基础知识梳理
服务器·网络·c++·网络协议·学习·http·https