当前位置:网站首页>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=[]
}
}
边栏推荐
- MFC handy notes
- Qt随手笔记(二)Edit控件及float,QString转化、
- 论文笔记(SESSION-BASED RECOMMENDATIONS WITHRECURRENT NEURAL NETWORKS)
- Modern medicine in the era of "Internet +"
- Phpexcel export Emoji symbol error
- 学习笔记之常用数组api 改变原数组和不改变原数组的有哪些?
- 新公链Aptos何以拉满市场期待值?
- Mysql5.7.25 master-slave replication (one-way)
- Cloud native (36) | introduction and installation of harbor in kubernetes
- Mo team learning notes (I)
猜你喜欢

Registration module use case writing

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

Xiaobai makes a wave of deep copy and shallow copy

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

Fiddler download and installation

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

Applet record

2021 windows penetration of "Cyberspace Security" B module of Shandong secondary vocational group (analysis)

QT handy notes (III) use qtcharts to draw a line chart in VS
![Sqoop [environment setup 01] CentOS Linux release 7.5 installation configuration sqoop-1.4.7 resolve warnings and verify (attach sqoop 1 + sqoop 2 Latest installation package +mysql driver package res](/img/8e/265af6b20f79b21c3eadcd70cfbdf7.png)
Sqoop [environment setup 01] CentOS Linux release 7.5 installation configuration sqoop-1.4.7 resolve warnings and verify (attach sqoop 1 + sqoop 2 Latest installation package +mysql driver package res
随机推荐
Principle analysis and source code interpretation of service discovery
Double authentication of server and client
Write a script that can run in Bash / shell and PowerShell
Wechat applet learning notes 2
Wechat H5 payment on WAP, for non wechat browsers
服务器内存故障预测居然可以这样做!
新公链Aptos何以拉满市场期待值?
高斯消元
挡不住了,纯国产PC已就位,美国的软硬件体系垄断正式被破
Sublime install plug-ins
(二)面扫描仪与机械臂的手眼标定(眼在手外:九点标定)
Unstoppable, pure domestic PCs have been in place, and the monopoly of the U.S. software and hardware system has been officially broken
解释一下自动装箱和自动拆箱?
JS table auto cycle scrolling, mouse move in pause
spolicy请求案例
Uni app learning summary
asp. Net using redis cache
m进制数str转n进制数
Leetcode 504. 七进制数
学习笔记之常用数组api 改变原数组和不改变原数组的有哪些?