当前位置:网站首页>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=[]
}
}
边栏推荐
- Development to testing: a six-year road to automation starting from 0
- 2022 zhongkepan cloud - server internal information acquisition and analysis flag
- Basic knowledge of website design
- M-ary number STR to n-ary number
- [MySQL database] a collection of basic MySQL operations - the basis of seeing (adding, deleting, modifying, and querying)
- Mo team learning summary (II)
- I finished watching this video on my knees at station B
- 2021 windows penetration of "Cyberspace Security" B module of Shandong secondary vocational group (analysis)
- B站这个视频我是跪着看完的
- Cloud native (36) | introduction and installation of harbor in kubernetes
猜你喜欢

Node memory overflow and V8 garbage collection mechanism
![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
![[datawhale] [machine learning] Diabetes genetic risk detection challenge](/img/98/7981af7948feb73168e5200b3dfac9.png)
[datawhale] [machine learning] Diabetes genetic risk detection challenge

MQTT X CLI 正式发布:强大易用的 MQTT 5.0 命令行工具

高斯消元

MySQL 5.7.25 source code installation record

Spolicy request case

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

挡不住了,纯国产PC已就位,美国的软硬件体系垄断正式被破

Azkaban【基础知识 01】核心概念+特点+Web界面+架构+Job类型(一篇即可入门Azkaban工作流调度系统)
随机推荐
解决npm -v突然失效 无反应
官方颁发的SSL证书与自签名证书结合实现网站双向认证
Flutter Event 派发
Network flow learning notes
服务器、客户端双认证(2)
高斯消元
Learning notes: what are the common array APIs that change the original array or do not change the original array?
Customize permission validation in blazor
Mqtt x cli officially released: powerful and easy-to-use mqtt 5.0 command line tool
RMQ学习笔记
protobuf的基本用法
Azkaban [basic knowledge 01] core concepts + features +web interface + Architecture +job type (you can get started with Azkaban workflow scheduling system in one article)
Show default image when wechat applet image cannot be displayed
2022 zhongkepan cloud - server internal information acquisition and analysis flag
Uni app learning summary
PHP one-time request lifecycle
Mo team learning notes (I)
Alibaba cloud technology expert haochendong: cloud observability - problem discovery and positioning practice
R language ggpubr package ggsummarystats function visualizes the grouping box diagram (custom grouping color) and adds the statistical values corresponding to the grouping under the x-axis label (samp
[datawhale] [machine learning] Diabetes genetic risk detection challenge