当前位置:网站首页>Rowselection emptying in a-table
Rowselection emptying in a-table
2022-07-26 09:53:00 【Zhou Xiaotiao】
Problem description :
Choose a-table Medium rowSelection after , Cancel the previously prepared operation , Switch tab page , When you come back again rowSelection Still selected . What needs to be solved is : Switch tab When the page comes back , Empty rowSelection Selected state of .
Solve the code :
html in :
<a-table :columns="column" :data-source="dataList"
:rowKey="record => record.guid || record.stcd"
:pagination="false"
:row-selection="rowSelection"
:scroll="{ x:1200,y:height}"
bordered
:loading="dataListLoading"/>
data in :
data() {
column: columns[this.$parent.active][0],
dataList: [],
height:0,
dataListLoading:false,
// Store selected rows Array of
dataListSelectionList: [],
selectedRowKeys: [],
}
computed in :
computed: {
rowSelection() {
return {
//onChange Method ,rowSelection Triggered on change
onChange: (selectedRowKeys, list) => {
// Gets the key Elements , And the following selectedRowKeys Properties are used in conjunction with , Said to rowSelection Bind one v-model, by this.selectedRowKeys
this.selectedRowKeys=selectedRowKeys
// Get all elements of the selected row
this.dataListSelectionList = list
},
selectedRowKeys:this.selectedRowKeys,
}
},
}
Last , To realize emptying rowSelection Selected state , stay methods In the corresponding method of :
methods:{
clearRowSelection() {
// Empty all elements of the selected row
this.dataListSelectionList = []
// The... Of the selected row will be displayed keys empty ( That is, clear the selected state )
this.selectedRowKeys=[]
}
}
边栏推荐
- Azkaban【基础知识 01】核心概念+特点+Web界面+架构+Job类型(一篇即可入门Azkaban工作流调度系统)
- Sublime install plug-ins
- copyTo
- (二)面扫描仪与机械臂的手眼标定(眼在手外:九点标定)
- What is the principle of reflection mechanism?
- Fiddler download and installation
- 2019 ICPC Asia Yinchuan Regional(水题题解)
- Sqoop【付诸实践 02】Sqoop1最新版 全库导入 + 数据过滤 + 字段类型支持 说明及举例代码(query参数及字段类型强制转换)
- R language ggplot2 visualization: align the legend title to the middle of the legend box in ggplot2 (default left alignment, align legend title to middle of legend)
- IE7 set overflow attribute failure solution
猜你喜欢

QT handy notes (III) use qtcharts to draw a line chart in VS

苹果独占鳌头,三星大举复兴,国产手机在高端市场颗粒无收

spolicy请求案例

Azkaban【基础知识 01】核心概念+特点+Web界面+架构+Job类型(一篇即可入门Azkaban工作流调度系统)

Search module use case writing

asp. Net using redis cache

服务发现原理分析与源码解读

MySQL 5.7.25 source code installation record
![[datawhale] [machine learning] Diabetes genetic risk detection challenge](/img/98/7981af7948feb73168e5200b3dfac9.png)
[datawhale] [machine learning] Diabetes genetic risk detection challenge

Registration module use case writing
随机推荐
Tableviewcell highly adaptive
Gauss elimination solves the inverse of matrix (Gauss)
M-ary number STR to n-ary number
莫队学习总结(二)
EOJ 2020 January race E-number transformation
Redis sentinel mode setup under Windows
Principle analysis and source code interpretation of service discovery
EOJ 2020 1月月赛 E数的变换
2021 windows penetration of "Cyberspace Security" B module of Shandong secondary vocational group (analysis)
高斯消元求解异或线性方程组
The use of MySQL in nodejs
AR model in MATLAB for short-term traffic flow prediction
2019 ICPC Asia Yinchuan Regional(水题题解)
2022年中科磐云——服务器内部信息获取 解析flag
Qt随手笔记(三)在vs中使用QtCharts画折线图
QT handy notes (II) edit control and float, qstring conversion
Sqoop【环境搭建 01】CentOS Linux release 7.5 安装配置 sqoop-1.4.7 解决警告并验证(附Sqoop1+Sqoop2最新版安装包+MySQL驱动包资源)
Registration module use case writing
What is the principle of reflection mechanism?
高斯消元