Element按钮组件能实现哪些效果,具体用法是什么
Admin 2022-06-13 群英技术资讯 1242 次浏览
很多朋友都对“Element按钮组件能实现哪些效果,具体用法是什么”的内容比较感兴趣,对此小编整理了相关的知识分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获,那么感兴趣的朋友就继续往下看吧!按钮是很常用的,Element的按钮功能还是比较全面的,本篇就来介绍下。
先看下各种按钮的效果图:

在分析源码前,我们先来看一下官方文档对于button的使用说明:

el-button按钮的分类基本是靠颜色区分的,另外还有一种文本按钮type="text",文本按钮由于比较小,比较适合用于表格每行的操作栏部分。
按钮分类:
<el-button>默认</el-button> <el-button type="primary">primary</el-button> <el-button type="success">success</el-button> <el-button type="info">info</el-button> <el-button type="warning">warning</el-button> <el-button type="danger">danger</el-button> <el-button type="text">text</el-button>
Element提供了朴素按钮、圆角按钮、圆形按钮,需要注意的是圆形按钮一般只放一个图标进去,代码如下:
按钮样式:
<el-button type="primary" plain>朴素按钮</el-button> <el-button type="primary" round>圆角按钮</el-button> <el-button type="primary" circle icon="el-icon-search"></el-button>
按钮状态其实就是HTML标准的功能,通过disabled实现禁用即可。
按钮状态:
<el-button type="primary">正常</el-button> <el-button type="primary" disabled>禁用</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>默认</el-button> <el-button type="primary" size="medium ">medium</el-button> <el-button type="primary" size="small">small</el-button> <el-button type="primary" size="mini">mini</el-button>
el-button提供的功能已经比较完善了,拿来即可即可。注意不推荐自己定义style来修改默认样式,容易导致外观不统一。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:mmqy2019@163.com进行举报,并提供相关证据,查实之后,将立刻删除涉嫌侵权内容。
猜你喜欢
本文主要介绍了iview 权限管理,iview-admin2.0自带权限管理。可以通过设置路由的meta对象的参数access来分配权限。感兴趣的可以了解一下
这篇文章主要介绍了 vue 动态组件component ,vue提供了一个内置的<component>,专门用来实现动态组件的渲染,这个标签就相当于一个占位符,需要使用is属性指定绑定的组件,想了解更多详细内容的小伙伴请参考下面文章的具体内容
VueUse 是一个基于 Composition API 的实用函数集合。本文就详细的介绍了VueUse的具体用法,具有一定的参考价值,感兴趣的可以了解一下
Cocos Creator 允许你将代码拆分成多个脚本文件,并且让它们相互调用。这个步骤简称为 模块化。
本篇文章带大家聊聊JavaScript解构(Destructuring)的5个有趣用法,希望给大家有所帮助!
成为群英会员,开启智能安全云计算之旅
立即注册关注或联系群英网络
7x24小时售前:400-678-4567
7x24小时售后:0668-2555666
24小时QQ客服
群英微信公众号
CNNIC域名投诉举报处理平台
服务电话:010-58813000
服务邮箱:service@cnnic.cn
投诉与建议:0668-2555555
Copyright © QY Network Company Ltd. All Rights Reserved. 2003-2020 群英 版权所有
增值电信经营许可证 : B1.B2-20140078 粤ICP备09006778号 域名注册商资质 粤 D3.1-20240008