当前位置:网站首页>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=[]
}
}
边栏推荐
猜你喜欢
[fluorescent character effect]
Apple dominates, Samsung revives, and domestic mobile phones fail in the high-end market
protobuf的基本用法
在Blazor 中自定义权限验证
Development to testing: a six-year road to automation starting from 0
解决ProxyError: Conda cannot proceed due to an error in your proxy configuration.
CSV data file settings of JMeter configuration components
Fiddler packet capturing tool for mobile packet capturing
Leetcode 504. 七进制数
2022年中科磐云——服务器内部信息获取 解析flag
随机推荐
图解用户登录验证流程,写得太好了!
Nodejs service background execution (forever)
Azkaban【基础知识 01】核心概念+特点+Web界面+架构+Job类型(一篇即可入门Azkaban工作流调度系统)
[datawhale] [machine learning] Diabetes genetic risk detection challenge
Alibaba cloud technology expert haochendong: cloud observability - problem discovery and positioning practice
Azkaban [basic knowledge 01] core concepts + features +web interface + Architecture +job type (you can get started with Azkaban workflow scheduling system in one article)
JS judge the data types object.prototype.tostring.call and typeof
Applet record
小白搞一波深拷贝 浅拷贝
Solve NPM -v sudden failure and no response
Redis sentinel mode setup under Windows
IIS website configuration
Mqtt x cli officially released: powerful and easy-to-use mqtt 5.0 command line tool
面试突击68:为什么 TCP 需要 3 次握手?
IE7 set overflow attribute failure solution
Cloud native (36) | introduction and installation of harbor in kubernetes
Logical architecture of MySQL
MFC handy notes
JS one line code to obtain the maximum and minimum values of the array
Xiaobai makes a wave of deep copy and shallow copy