ElementUI按钮组件

Myth丶恋晨 2021-07-24 22:34 1009阅读 0赞

按钮组件(示例)

  1. 1.默认样式按钮
  2. <el-row>
  3. <el-button>默认按钮</el-button>
  4. <el-button type="primary">主要按钮</el-button>
  5. <el-button type="success">成功按钮</el-button>
  6. <el-button type="info">信息按钮</el-button>
  7. <el-button type="warning">警告按钮</el-button>
  8. <el-button type="danger">危险按钮</el-button>
  9. </el-row>
  10. 2.简洁按钮 plain 鼠标移动上去才会显示背景颜色
  11. <el-row>
  12. <el-button plain>朴素按钮</el-button>
  13. <el-button type="primary" plain>主要按钮</el-button>
  14. <el-button type="success" plain>成功按钮</el-button>
  15. <el-button type="info" plain>信息按钮</el-button>
  16. <el-button type="warning" plain>警告按钮</el-button>
  17. <el-button type="danger" plain>危险按钮</el-button>
  18. </el-row>
  19. 3.使用圆角按钮 round
  20. <el-row>
  21. <el-button round>圆角按钮</el-button>
  22. <el-button type="primary" round>主要按钮</el-button>
  23. <el-button type="success" round>成功按钮</el-button>
  24. <el-button type="info" round>信息按钮</el-button>
  25. <el-button type="warning" round>警告按钮</el-button>
  26. <el-button type="danger" round>危险按钮</el-button>
  27. </el-row>
  28. 4.图标按钮 idco:具体要显示的图标
  29. <el-row>
  30. <el-button icon="el-icon-search" circle></el-button>
  31. <el-button type="primary" icon="el-icon-edit" circle></el-button>
  32. <el-button type="success" icon="el-icon-check" circle></el-button>
  33. <el-button type="info" icon="el-icon-message" circle></el-button>
  34. <el-button type="warning" icon="el-icon-star-off" circle></el-button>
  35. <el-button type="danger" icon="el-icon-delete" circle></el-button>
  36. </el-row>

在这里插入图片描述

按钮组件的详细使用

日后使用element ui的相关组件时需要注意的是 所有组件都是el-组件名称开头
创建按钮:<el-button>默认按钮</el-button>

#

#

组件属性使用

总结:在element中所有的组件的属性使用都是直接将属性名=属性值方式写在对应的组件标签上,boolean类型的属性默认为false可以简写一个属性名字表示为true。

在这里插入图片描述
示例

  1. <div>
  2. <h1>创建简单的按钮</h1>
  3. <el-button>默认按钮</el-button>
  4. <h1>使用按钮的属性</h1>
  5. <el-button type="primary" size="mini" round="true" loading>primary</el-button>
  6. <el-button type="primary" size="small" round="true" disabled>primary</el-button>
  7. <el-button type="primary" size="medium" circle icon="el-icon-delete-solid"></el-button>
  8. </div>

在这里插入图片描述

按钮组的使用

按钮组的使用就是通过<el-button-group>把多个按钮包裹起来

  1. <el-button-group>
  2. <el-button type="primary" plain round icon="el-icon-back"></el-button>
  3. <el-button type="primary" plain round icon="el-icon-right"></el-button>
  4. </el-button-group>

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,1009人围观)

还没有评论,来说两句吧...

相关阅读