wchbrad / vue-easy-tree

A tree component based on vue2.x that supports a small amount of data or a large amount of data, multiple functions, and virtual scrolling.
MIT License
130 stars 40 forks source link

不能使用height:​ 100%定义高度 #23

Closed 361so closed 1 year ago

361so commented 1 year ago

提示报错:Error in v-on handler: "Error: Rendered items limit reached"

It seems the scroller element isn't scrolling, so it tries to render all the items at once. Scroller: <div class=​"vue-recycle-scroller ready direction-vertical" style=​"height:​ 100%;​ overflow-y:​ auto;​ scroll-behavior:​ smooth;​">​…​

​ vue-virtual-scroller.esm.js?e508:619 Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.

发现子节点超过2000多好像就会报这样的错,然后数据就只会加载一半

wchbrad commented 1 year ago

不是的,使用height属性时请使用像height="calc(100vh - 40px)"或者height="500px"这种可计算的高度,不要使用height:​ 100%这种相对高度