element-ui Checkbox 实现单选
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
免费下载资源
·
<el-table id="tables" ref="multipleTable" row-key="id"
:data="tableData"
max-height="450"
border
style="width: 100%"
@selection-change="handleSelectionChange" //将用到此
:header-cell-style="{background:'#F8F8FA',color:'#606266',fontSize:'13px',fontWeight:'bold'}"
>
<el-table-column type="selection" width="60" align="center" :reserve-selection="true"></el-table-column>
<el-table-column prop="id" label="序号" width="120" align="center"> </el-table-column>
<el-table-column prop="name" label="话题名称" align="center" show-overflow-tooltip> </el-table-column>
</el-table>
handleSelectionChange(val) {
if(val.length >=2){
// 删除索引为0的
// console.log(val.splice(0,val.length-1),'被删除的')
let arrays = val.splice(0,val.length-1)
arrays.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row); //除了当前点击的,其他的全部取消选中
})
}
// console.log(val,'最后得到的')this.array = val
}
GitHub 加速计划 / eleme / element
54.06 K
14.63 K
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:2 个月前 )
c345bb45
7 个月前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 7 个月前
更多推荐
已为社区贡献4条内容
所有评论(0)