網站首頁 編程語言 正文
目錄
一 、需求
二、方法之cell-style
1 、cell-style
2 、表格綁定cell-style屬性
3 、數據操作
三 、方法之el-tag
1 、el-table-column
2、方法eachColor(){}
一 、需求
根據列表列值的不同顯示不同顏色
二、方法之cell-style
1 、cell-style
cell-style 單元格的 style 的回調方法,也可以使用一個固定的 Object 為所有單元格設置一樣的 Style。 Function({row, column, rowIndex, columnIndex})/Object
- row:當前行
- columnIndex:?列下標
2 、表格綁定cell-style屬性
<el-table :data="tableData" :row-style="rowState" :cell-style="cellStyle" style="width: 100%" >
3 、數據操作
const cellStyle= ({ row, column, rowIndex, columnIndex })=> { // 狀態列字體顏色 if (row.level >2 && columnIndex === 8) { return {'color': 'red'}; //方法1 return "color: #FF0000"; //方法2 } }
三 、方法之el-tag
1 、el-table-column
<el-table-column label="姓名" width="180"> <template slot-scope="scope"> <el-tag :type="eachColor(scope.row.level)">{{ scope.row.level }}</el-tag> </el-popover> </template> </el-table-column>
2、方法eachColor(){}
eachColor(level) { if (level == "5") { return "danger"; } if (level == "4") { return "warning"; } if (level == "3") { return "info"; } ... },
有用請點贊,養成良好習慣!
疑問、交流、鼓勵請留言!
原文鏈接:https://libusi.blog.csdn.net/article/details/129655650
- 上一篇:沒有了
- 下一篇:沒有了
相關推薦
- 2022-06-12 Android?Flutter利用貝塞爾曲線畫一個小海豚_Android
- 2021-12-16 linux下wget命令的基本使用方法_Linux
- 2022-09-17 C++?中如何結束?while?(cin>>str)?的輸入_C 語言
- 2022-08-03 sql注入報錯之注入原理實例解析_數據庫其它
- 2023-05-06 pandas中groupby操作實現_python
- 2022-10-07 OpenCV實現物體的凸包檢測的示例代碼_C 語言
- 2023-02-07 Go?singleflight使用以及原理_Golang
- 2022-03-15 使用jib-maven-plugin插件打包docker鏡像上傳到私有鏡像庫,為了賬戶安全,需要設置
- 欄目分類
-
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支