element ui Angular学习笔记,一

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