当前位置: 首页 > news >正文

element-plus 使用笔记

npm install element-plus --save

自动导入

npm install -D unplugin-vue-components unplugin-auto-import
// vite.config.js
···
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
···
export default defineConfig({plugins: [···,AutoImport({resolvers: [ElementPlusResolver()],}),Components({resolvers: [ElementPlusResolver()],}),],···
})

el-table

可对数据进行排序、筛选、对比或其他自定义操作

fit 默认 true
是否自动撑开列填充满表格容器
设为false 需要手动设置 列的 width

lazy 配合 load

修改行悬停高亮的样式 --el-table-row-hover-bg-color
表格边框颜色 --el-table-border-color

去除底部白线,border没有看before

树形数据配合多选,无法选到子集

el-table-column

type=“selection/index/expand”
分别对应多选框 / 序号 / 折叠符号

filters 与 filter-method 配置过滤
当表格数据更新时,筛选会失效

用min-width 设置比例 总数字自动分配
width 不太好用

show-overflow-tooltip 不换行,超出通过提示框显示

el-menu

el-menu-item 的 route 属性生效需要 设置 router=“ture”

el-tag

关闭图标 需要 deep 修改样式

el-tree

透明背景 避免悬停选中白底

// sass
.el-tree {background-color: transparent;color: #a4adce;:deep(.el-tree-node__content:hover),:deep(.el-tree-node:hover){background-color: transparent;}:deep(.el-tree-node:focus) {background-color: transparent;color: white;>.el-tree-node__content {background-color: transparent;color: white;}}
}

expand-on-click-node 点击结点是否展开,默认true展开

node-key 通常设为id default-key 会用到

setCheckedKeys([]) // 清空所有checked

修改页结点样式

:deep(.el-tree-node__children) {.el-tree-node.is-current {background-image: linear-gradient(to right, #1d305a, transparent, transparent);background-position-x: 35px;}
}
:deep(.is-current > .el-tree-node__content) {color: #CFD7FE
}

设置默认展开后,即便折叠也会展开其他后,再次被展开
默认选中并不会触发展开,setCurrentKey 可以触发展开

data 格式

[{id: '',label: '',children: ''}
]// node-key="id"
Props = {children: 'children',label: 'label',
}

el-pagination

只支持slot插槽 在layout中注册

background 为 false 时,是白色背景

v-loading 加载中

element-loading-background 设置加载中背景色

el-popconfirm

官方文档不够准确,没有展示 popper-class 属性

el-select-tree

props 不能漏,否则无法选择

<el-tree-select v-model="parent_id" :data="TreeData" :props="{label: 'label', value: 'value', childern: 'children'}" :render-after-expand="false" popper-class="position" check-strictly style="width: 70%;" node-key="tree_id" />

el-select

去除hover box-shadow

.el-select:hover {.el-input .el-input__wrapper {--el-input-hover-border-color: transparent;}
}

options 数据格式

[{label: '', value: ''}
]

vue scoped 特点

http://www.lryc.cn/news/4796.html

相关文章:

  • 《蓝桥杯每日一题》 前缀和·Acwing 3956. 截断数组
  • 促进关键软件高层次人才培养:平凯星辰与华东师范大学签订联合博士培养合作协议
  • Java程序员的日常——经验贴
  • 电商API社区,商品数据,关键词搜索等
  • LEADTOOLS 22.0.6 UPDATE-Crack
  • 什么是OJ? 东方博宜题库部分题解
  • 企业工程项目管理系统源码的各模块及其功能点清单
  • 【电商开发手册】订单-下单
  • 数据结构 - 优先级队列(堆)
  • PDF内容提取器:ByteScout PDF Extractor SDK Crack
  • 字母板上的路径[提取公共代码,提高复用率]
  • c# winform错误大全
  • AI_News周刊:第一期
  • 搭建mysql主从复制
  • 内存溢出、内存泄露的概述及常见情形
  • Linux 中断实验
  • 【c++】指针
  • 别具一格的婚礼,VR全景+婚礼的优势展现在哪里?
  • 【GD32F427开发板试用】5. SPI驱动TFTLCD屏幕
  • 测试2年还拿实习生的薪资打发我,你后悔去吧····
  • 面向对象程序(C++)设计基础
  • conda安装nodejs版本过低解决方法
  • 前端工程师leetcode算法面试必备-二分搜索算法(下)索算法(下)
  • 使用Autowired为什么会被IDEA警告,应该怎么修改最佳
  • 面向对象(中)
  • 【云原生】promehtheus整合grafana实现可视化监控实战
  • Linux 内核定时器实验
  • 喜欢大屏电视?那就选择酷开系统,实现智能生活享受
  • PMP应该如何备考?
  • AcWing《蓝桥杯集训·每日一题》—— 3956.截断数组