element ui Angular学习笔记(一)

本文介绍了 Element Angular 组件库的安装与使用方法,包括如何通过 npm 安装、Angular-cli 引入、布局组件配置及按钮、图标等常用组件的使用技巧。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.element ui安装

npm i --save element-angular

2.Angular-cli引入

引入后需要开启ElModule.forRoot(),也可以单独引入某个组件入ElChildModules.ElButton

3.指令

[el-class]

如:<el-alert [el-class]="'myClass'">text</el-alert>

.myClass { >div { color: #ccc; } }

在自己的@comopnent内使用encapsulation: ViewEncapsulation.None来覆盖样式,使element Angular可以影响组件样式

 

4.布局

layout布局

基础采用24分栏布局。

el-row,el-col,span,gutter(间隔),type="flex"(对齐,justify:start, center, end, space-between, space-around)

row属性:gutter,type,justify,align

col属性:span,offset,push,pull,xs,sm,md,lg,xl

container布局

el-container(direction:horizontal / vertical),el-header(height),el-aside(width),el-main,el-footer(height)

 

5.icon图标

5.1使用class=“el-icon+-iconName”

5.2使用el-icon,name=

<span class="icons"> <i class="el-icon-edit"></i> <el-icon name="share"></el-icon> <el-icon name="delete"></el-icon> </span> <el-button type="primary" icon="search">搜索</el-button>

 

6.按钮button

 

size尺寸stringarge,small,mini-
type类型stringprimary,success,warning,danger,info,text-
plain是否朴素按钮booleanfalse
round是否圆形按钮booleanfalse
loading是否加载中状态booleanfalse
elDisabled是否禁用状态booleanfalse
icon图标,已有的图标库中的图标名string-
native-type原生 type 属性stringbutton,submit,resetbutton

转载于:https://www.cnblogs.com/ljwsyt/p/9007407.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值