Giter VIP home page Giter VIP logo

Comments (6)

xiaocheng555 avatar xiaocheng555 commented on July 22, 2024

VitualColumn的fixed属性被改变后,原先获取的scroller从dom中消失,计算显示条数时候,需要重新获取。建议减轻fixed属性,变化后重新获取scroller。

不太懂你的意思,有代码或者图片吗

from el-table-virtual-scroll.

donnyzxt avatar donnyzxt commented on July 22, 2024

重现方法是代码动态切换字段的fixed,然后scroll对应的dom就从页面上找不到了,后边计算就错了。修改fixed后,el-table回重新绘制整个组件。

from el-table-virtual-scroll.

xiaocheng555 avatar xiaocheng555 commented on July 22, 2024

image

https://xiaocheng555.github.io/el-table-virtual-scroll/#/CaseDemo?code=CaseDemo&codeTitle=%E6%A1%88%E4%BE%8B
在这个页面,你说的问题是这里切换固定列时,固定列的滚动位置不对,有偏移是吗

重现方法是代码动态切换字段的fixed,然后scroll对应的dom就从页面上找不到了,后边计算就错了。修改fixed后,el-table回重新绘制整个组件。

from el-table-virtual-scroll.

donnyzxt avatar donnyzxt commented on July 22, 2024

fixed从''转成'left',逻辑中就会重新计算展示范围,但是因为scroll的dom元素被vue重新绘制了,之前存的那个scroll对象需要重新拿一下。

from el-table-virtual-scroll.

xiaocheng555 avatar xiaocheng555 commented on July 22, 2024

fixed从''转成'left',逻辑中就会重新计算展示范围,但是因为scroll的dom元素被vue重新绘制了,之前存的那个scroll对象需要重新拿一下。

切换fixed不会重绘整个表格,只会重新渲染表格内的数据,scroller没有变化的

from el-table-virtual-scroll.

xiaocheng555 avatar xiaocheng555 commented on July 22, 2024

fixed从''转成'left',逻辑中就会重新计算展示范围,但是因为scroll的dom元素被vue重新绘制了,之前存的那个scroll对象需要重新拿一下。

调用下面方法可以可以重新刷新scroller:
this.$refs.virtualScroll.initData()

from el-table-virtual-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.