Comments (2)
已经按照这个解决方案修改,目前没有问题了
from el-table-virtual-scroll.
由于vuex修改数据需要通过mutation,所以在绑定数据源的时候我深克隆了数据。 如果这时用户点击了全选按钮,实际被修改了$v_checked属性的是这份克隆数据。 接下来如果用户对数据进行了操作,比如修改了数据的一个属性,就会触发mutation对原始数据进行修改,这时绑定数据源也跟着发生变化,重新克隆了一份。 但是由于原始数据上没有$v_checked字段,所以页面上的checkbox选中状态消失,但是由于没有发生选中变更,所以 @selection-change事件不会被触发。 我现在的处理方式是,在 @selection-change事件中记录下所有数据的id,然后在 @change 事件中依次对数据设置一次$v_checked属性。
可以不用管$v_checked字段,在selection-change事件中返回所有选中的rows数据,记录选中数据ids,然后在页面初始化时,通过ids找到选中rows,调用toggleRowSelection(rows, true)方法让选中表格数据
from el-table-virtual-scroll.
Related Issues (20)
- 自定义固定列 所有列宽总宽度小于表格宽度时 固定列样式有问题 HOT 2
- 更新到1.1.3后报错 el-table-column未注册 HOT 14
- 表格隐藏状态下更新绑定数组长度,显示后滚动条位置异常 HOT 9
- 使用二次封装的el-table时,cellFixedStyle() 方法里获取table时没有使用 getElTable() 方法获取 HOT 2
- row-span-key对应的函数只能返回一个key吗 ,多列参与了合并行怎么处理? HOT 2
- 表格列数过多仍然会卡顿,这个会考虑解决吗? HOT 4
- 使用toggleRowSelection选中多行会卡死,有什么办法高效选中多行么 HOT 4
- 新增 Backtop 回到顶部 功能 HOT 1
- 是否考虑将element-table的select事件集成进来 HOT 3
- 是否考虑将element-table的select事件集成进来
- scrollTo事件不精确的问题 HOT 3
- 希望支持横向滚动条sticky HOT 4
- 关于在resize后vfixed类名错误问题 HOT 1
- 虚拟表格如果动态添加数据的时候就会出现空白,主要是产生的偏移值不对 HOT 2
- el-table-column 添加 show-overflow-tooltip 之后,在当前show-overflow-tooltip列滚动时,页面会抖动 HOT 1
- this.elTable.syncPosition is not a function HOT 3
- 大神考虑支持下vue3不? HOT 1
- 复制案例换了数据 虚拟滚动就不生效了
- 增加selection列,使用filter实现搜索功能,搜索前选中的行,搜索后仍被选中,这个是bug还是做了处理 HOT 29
- 虚拟列表是否有类似el-table实例中的selection属性 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from el-table-virtual-scroll.