使用element Table表格獲取勾選的數(shù)據(jù)
更新時間:2025年12月03日 09:38:21 作者:霸氣小男
通過實例介紹了如何使用elementTable表格組件獲取勾選的數(shù)據(jù),總結個人經(jīng)驗,旨在為讀者提供參考和學習資源
element Table表格獲取勾選的數(shù)據(jù)

看實例吧
<template>
<div>
<el-table ref="elTable" :data="tableData" border default-expand-all @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
</el-table>
</div>
</template><script>
export default {
data () {
return {
targetSelectArr:[]
}
},
methods:{
handleSelectionChange (selectionArr) {
let _targetArr = []
// 遍歷已選擇數(shù)據(jù)id
selectionArr.map((item) => {
_targetArr.push(item.id)
})
this.targetSelectArr = _targetArr
}
}
}
</script>
?總結
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
您可能感興趣的文章:
- Element-Plus表格實現(xiàn)Table自定義合并行數(shù)據(jù)
- vue elementui table編輯表單時彈框增加編輯明細數(shù)據(jù)的實現(xiàn)
- elementUI?Table?自定義表頭動態(tài)數(shù)據(jù)及插槽的操作
- vue3?element?plus?table?selection展示數(shù)據(jù),默認選中功能方式
- vue(element ui)el-table樹形表格展示以及數(shù)據(jù)對齊方式
- ElementUI?el-table?樹形數(shù)據(jù)的懶加載的實現(xiàn)
- Vue Element UI 中 el-table 樹形數(shù)據(jù) tree-props 多層級使用避坑指南
相關文章
vueCli?4.x升級5.x報錯:Progress?Plugin?Invalid?Options的解決方法
本文主要介紹了vueCli?4.x升級5.x報錯:Progress?Plugin?Invalid?Options的解決方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2024-01-01
elementUI組件中el-date-picker限制時間范圍精確到小時的方法
現(xiàn)在需要做一個時間選擇器,可以根據(jù)小時(同時選天和小時)和天?和月,節(jié)假日等類型控制日歷的選擇樣式,下面這篇文章主要給大家介紹了關于elementUI組件中el-date-picker限制時間范圍精確到小時的相關資料,需要的朋友可以參考下2023-04-04
Vue如何根據(jù)id在數(shù)組中取出數(shù)據(jù)
這篇文章主要介紹了Vue如何根據(jù)id在數(shù)組中取出數(shù)據(jù),具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2022-08-08

