Element组件浅尝辄止4:Button组件

news2024/10/7 16:16:30

Button按钮组件:用途太广泛了,几乎参与到了日常开发中的方方面面

1.如何使用?How?

 

//使用type、plain、round和circle属性来定义 Button 的样式。

<el-row>
  <el-button>默认按钮</el-button>
  <el-button type="primary">主要按钮</el-button>
  <el-button type="success">成功按钮</el-button>
  <el-button type="info">信息按钮</el-button>
  <el-button type="warning">警告按钮</el-button>
  <el-button type="danger">危险按钮</el-button>
</el-row>

<el-row>
  <el-button plain>朴素按钮</el-button>
  <el-button type="primary" plain>主要按钮</el-button>
  <el-button type="success" plain>成功按钮</el-button>
  <el-button type="info" plain>信息按钮</el-button>
  <el-button type="warning" plain>警告按钮</el-button>
  <el-button type="danger" plain>危险按钮</el-button>
</el-row>

<el-row>
  <el-button round>圆角按钮</el-button>
  <el-button type="primary" round>主要按钮</el-button>
  <el-button type="success" round>成功按钮</el-button>
  <el-button type="info" round>信息按钮</el-button>
  <el-button type="warning" round>警告按钮</el-button>
  <el-button type="danger" round>危险按钮</el-button>
</el-row>

<el-row>
  <el-button icon="el-icon-search" circle></el-button>
  <el-button type="primary" icon="el-icon-edit" circle></el-button>
  <el-button type="success" icon="el-icon-check" circle></el-button>
  <el-button type="info" icon="el-icon-message" circle></el-button>
  <el-button type="warning" icon="el-icon-star-off" circle></el-button>
  <el-button type="danger" icon="el-icon-delete" circle></el-button>
</el-row>

2.拓展用法?

  • 按钮禁用 

你可以使用disabled属性来定义按钮是否可用,它接受一个Boolean值,默认为false。

//你可以使用disabled属性来定义按钮是否可用,它接受一个Boolean值。

<el-row>
  <el-button disabled>默认按钮</el-button>
  <el-button type="primary" disabled>主要按钮</el-button>
  <el-button type="success" disabled>成功按钮</el-button>
  <el-button type="info" disabled>信息按钮</el-button>
  <el-button type="warning" disabled>警告按钮</el-button>
  <el-button type="danger" disabled>危险按钮</el-button>
</el-row>
  • 文字按钮

    没有边框和背景色的按钮。 

 

 

<el-button type="text">文字按钮</el-button>
<el-button type="text" disabled>文字按钮</el-button>
  • 图标按钮

    带图标的按钮可增强辨识度(有文字)或节省空间(无文字)。 

//设置icon属性即可,icon 的列表可以参考 Element 的 icon 组件,
//也可以设置在文字右边的 icon ,只要使用i标签即可,可以使用自定义图标。

<el-button type="primary" icon="el-icon-edit"></el-button>
<el-button type="primary" icon="el-icon-share"></el-button>
<el-button type="primary" icon="el-icon-delete"></el-button>
<el-button type="primary" icon="el-icon-search">搜索</el-button>
<el-button type="primary">上传<i class="el-icon-upload el-icon--right"></i></el-button>
  • 按钮组

    以按钮组的方式出现,常用于多项类似操作。

    //使用<el-button-group>标签来嵌套你的按钮。
    
    <el-button-group>
      <el-button type="primary" icon="el-icon-arrow-left">上一页</el-button>
      <el-button type="primary">下一页<i class="el-icon-arrow-right el-icon--right"></i></el-button>
    </el-button-group>
    <el-button-group>
      <el-button type="primary" icon="el-icon-edit"></el-button>
      <el-button type="primary" icon="el-icon-share"></el-button>
      <el-button type="primary" icon="el-icon-delete"></el-button>
    </el-button-group>
     
  • 加载中

    点击按钮后进行数据加载操作,在按钮上显示加载状态。 

//要设置为 loading 状态,只要设置loading属性为true即可。

<el-button type="primary" :loading="true">加载中</el-button>
  • 不同尺寸

    Button 组件提供除了默认值以外的三种尺寸,可以在不同场景下选择合适的按钮尺寸。 

//额外的尺寸:medium、small、mini,通过设置size属性来配置它们。

<el-row>
  <el-button>默认按钮</el-button>
  <el-button size="medium">中等按钮</el-button>
  <el-button size="small">小型按钮</el-button>
  <el-button size="mini">超小按钮</el-button>
</el-row>
<el-row>
  <el-button round>默认按钮</el-button>
  <el-button size="medium" round>中等按钮</el-button>
  <el-button size="small" round>小型按钮</el-button>
  <el-button size="mini" round>超小按钮</el-button>
</el-row>

 上述简单介绍了button组件的内容,想要深入浅出 具体的button定制可到按钮组件

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/859383.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

LeetCode150道面试经典题-移除元素(简单)

目录 1.题目 2.解题思路 3.解题代码 1.题目 移除元素 给你一个数组 nums 和一个值 val&#xff0c;你需要原地移除所有数值等于 val 的元素&#xff0c;并返回移除后数组的新长度。 不要使用额外的数组空间&#xff0c;你必须仅使用 O(1) 额外空间并原地修改输入数组。 元素…

mac-右键-用VSCode打开

1.点击访达&#xff0c;搜索自动操作 2.选择快速操作 3.执行shell脚本 替换代码如下&#xff1a; for f in "$" doopen -a "Visual Studio Code" "$f" donecommand s保存会出现一个弹框&#xff0c;保存为“用VSCode打开” 5.使用

Prometheus流程图(自绘)-核心组件-流程详解

阿丹手绘流程图&#xff1a;图片可能有点小查看的时候放大看看哈&#xff01; prometheus核心组件 prometheus server Prometheus Server是Prometheus组件中的核心部分&#xff0c;负责实现对监控数据的获取&#xff0c;存储以及查询。Prometheus Server可以通过静态配置管理…

Apikit 自学日记:API 异常监控-监控报告

在 api 管理中&#xff0c;查看 api 异常监控的监控报告&#xff0c;在 apikit 中也是常用的功能&#xff0c;通常你可以在流程综合报告页中看到当前流程在选定时间段内的整体监控情况... 在 APIkit 中监控报告有这几种类别&#xff1a; 单接口监控报告 流程监控报告 项目监控…

SQL注入之Oracle注入

SQL注入之Oracle注入 7.1 SQL注入之Oracle环境搭建 前言 Oracle Database&#xff0c;又名Oracle RDBMS&#xff0c;或简称Oracle。是甲骨文公司的一款关系数据库管理系统。它是在数据库领域一直处于领先地位的产品。可以说Oracle数据库系统是世界上流行的关系数据库管理系统…

ardupilot 三维向量如何进行旋转

目录 文章目录 目录摘要1.三维向量的旋转2.如何理解上面公式3.ardupilot中代码应用4.结论摘要 本节主要记录ardupilot中如何实现一个三维向量从一个坐标系转换到另外一个坐标系的过程,欢迎批评指正!!! 1.三维向量的旋转 这里需要特别注意,我们有时候需要把R系往B系转换,…

【C语言学习】函数的定义和调用

一、函数定义 要有返回类型、函数名和函数体 二、调用函数 函数名&#xff08;函数值&#xff09;&#xff1b; &#xff08;&#xff09;起到表示函数调用的重要作用&#xff0c;即使没有参数也需要&#xff08;&#xff09; 若有参数&#xff0c;则需要给出正确的数量和顺序…

【如何在Linux环境下进入Docker容器中的MySQL】

如何在Linux环境下进入Docker容器中的MySQL 查看所有容器 docker ps进入容器 docker exce -it {NAMES/CONTAINER ID} bash根据容器别名获取容器ID都可以进入到容器当中 3. 输入MySQL的账号和密码登录MySQL mysql -uroot -p{password}

Linux下 时间戳的转化

Linux下一般用date 记录当前时间&#xff0c;尤其是我们需要保存测试log的时候&#xff0c;或者设计一个跑多长时间的脚本都需要时间戳。下面看一下平时最常用的几种写法 1 date “%Y-%m-%d %H:%M” 显示具体时间 2 修改时间 date -s 3 date %s :当前时间的时间戳 显示具体时…

Maven介绍,部署在eclipse中

目录 一.Maven介绍 1&#xff0c;什么是maven&#xff1f; 2. 为什么maven会在企业中大量使用&#xff1f; 3.没有使用maven的前后区别? 4.maven在Java开发中的实际效果图 二.maven部署在eclipse中 1.下载maven在其官方网址下载&#xff08;当然实际下载也要根据个人的…

速度提升13%?SK海力士新一代芯片组即将发布,搭载LPDDR5T 内存

据称SK海力士最新LPDDR5T内存已在联发科的下一代移动平台&#xff08;可能是天玑9300&#xff09;上成功验证。 SK海力士宣布&#xff0c;联发科即将于今年内发布最新一代旗舰移动芯片组&#xff0c;其中包括速度高达9.6Gbps的LPDDR5T内存。与前一代海力士LPDDR5X相比&#xff…

htmlCSS-----案例展示

目录 前言 作品效果 html代码 CSS代码 图片资源 前言 在学习html过程中我们要试着去写写一些案例&#xff0c;通过这些案例让我们更加熟悉代码以及丰富我们的经验&#xff0c;下面是我个人写的一个案例&#xff0c;代码和图片也给出了大家&#xff0c;你们可以参考参考。…

TOMCAT部署及优化(Tomcat配置文件参数优化,Java虚拟机(JVM)调优)

TOMCAT tomcat &#xff1a;是一个开放源代码的web应用服务器&#xff0c;基于java代码开发的。也可以理解为tomacat就是处理动态请求和基于java代码的页面开发。可以在html当中写入java代码&#xff0c;tomcat可以解析html页面当中的java&#xff0c;执行动态请求&#xff0c;…

绽放趋势:Python折线图数据可视化艺术

文章目录 一 json数据格式1.1 json数据格式认识1.2 Python数据和Json数据的相互转换 二 pyecharts模块2.1 pyecharts概述2.2 pyecharts模块安装 三 pyecharts快速入门3.1 基础折线图3.2 pyecharts配置选项3.2.1 全局配置选项 3.4 折线图相关配置3.4.1 .add_yaxis相关配置选项3.…

LC-杨辉三角

LC-杨辉三角 链接&#xff1a;https://leetcode.cn/problems/pascals-triangle/submissions/ 上图就是一个杨辉三角&#xff0c;每个数等于他左上角的数与右上角的数之和。 第一行就是一个1&#xff1b;第二行是两个1&#xff1b;第三行的2就是它肩膀上两个1之和,其余的类似。…

最全网络安全(黑客)学习路线

在各大平台搜的网安学习路线都太粗略了。。。。看不下去了&#xff01; 我把自己整理的系统学习路线&#xff0c;拿出来跟大家分享了&#xff01;点击查看详细路线图 建议的学习顺序&#xff1a; 一、网络安全学习普法&#xff08;心里有个数&#xff0c;要进去坐几年&#xf…

初阶C语言-操作符详解(下)

&#x1f31e; “等春风得意&#xff0c;等时间嘉许&#xff01;” 接下来&#xff0c;我们把操作符没学完的继续学完&#xff01; 操作符详解 6.2sizeof和数组 7.关系操作符8.逻辑操作符9.条件操作符10.逗号表达式11.下标引用、函数调用和结构成员12.表达式求值12.1隐式类型转…

设计模式(2)工厂方法模式

一、 1、介绍&#xff1a;定义一个用于创建对象的接口&#xff0c;让子类决定实例化哪一个类。工厂方法使一个类的实例化延迟到其子类。简单工厂模式的最大优点在于工厂类中包含了必要的逻辑判断&#xff0c;根据客户端的选择条件动态实例化相关的类&#xff0c;对于客户端来说…

cesium学习记录06-视图、场景与相机

一、视图&#xff08;Viewer&#xff09; viewer是cesium的核心类&#xff0c;是一切的开端。通过new Cesium.Viewer(container, options)来创建一个Viewer对象&#xff0c;而通过这个 Viewer对象&#xff0c;可以添加图层、实体、相机控制等&#xff0c;以及设置一些全局属性…

Whisper.cpp 编译使用

Whisper.cpp 编译使用 whisper.cpp 是牛人 ggerganov 对 openai 的 whisper 语音识别模型用 C 重新实现的项目&#xff0c;开源在 github 上&#xff0c;具有轻量、性能高&#xff0c;实用性强等特点。这篇文章主要记录在 windows 平台&#xff0c;如何使用该模型在本地端进行…