網站首頁 編程語言 正文
判斷element Ui 表格(el-table)中復選框中的選中狀態
組件
<el-table
:data="newTableData"
@select="selectionRow"
@select-all="selectionRowAll"
style="width: 100%">
<el-table-column
align="center"
type="selection"
width="50"
>
</el-table-column>
<el-table-column
align="center"
type="index"
width="50"
label="序號"
></el-table-column>
<el-table-column
label="文件名稱"
align="center"
prop="name">
</el-table-column>
<el-table-column
label="操作"
align="center"
prop="filepath">
<template slot-scope="scope">
<a
style="color:#6abbf4"
:href=""
>下載</a>
</template>
</el-table-column>
</el-table>
方法
// 表格復選框事件
selectionRow(selection, row){
let selected = selection.length && selection.indexOf(row) !== -1; //為true時選中,為 0 時(false)未選中
if(selected){
this.deleteRowIdArray.push(row);
}
},
//表格全選事件
selectionRowAll(selection){
this.deleteRowIdArray = selection;
},
原文鏈接:https://blog.csdn.net/qq_42208679/article/details/111638368
相關推薦
- 2022-07-02 python之NAN和INF值處理方式_python
- 2022-05-04 EF使用數據注解特性創建表結構_實用技巧
- 2022-09-03 ahooks封裝cookie?localStorage?sessionStorage方法_React
- 2022-08-20 python使用tkinter模塊實現文件選擇功能_python
- 2022-06-04 python函數的兩種嵌套方法使用_python
- 2022-12-21 redis?setIfAbsent返回null的問題及解決_Redis
- 2022-10-12 go實現限流功能示例_Golang
- 2022-12-10 Input系統之InputReader概要性實例分析_Android
- 最近更新
-
- 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同步修改后的遠程分支