long Cai

Results 6 comments of long Cai

你可以使用一个中间组件,不需要把需要渲染的组件传递给他 ![image](https://user-images.githubusercontent.com/41094378/199171845-28c4646f-2156-4fe6-90ab-b5dc1fc71663.png) ![image](https://user-images.githubusercontent.com/41094378/199171954-9c2d08bd-659e-4ddb-b6df-de947d4a33e9.png)

但是还有一种情况,就是接收到消息时,如果在底部,那么就需要保持滚动到底部的情况,你说的这种是每次都不会滚动到底部。 但是如果在底部,那么是需要保持滚动到底部的。我如何知道是否在底部,我目前是使用的伪代码 ![image](https://user-images.githubusercontent.com/41094378/199877845-5945b543-5fc8-442a-9764-e807fd0472e3.png) `throttle`是一个节流函数 ![image](https://user-images.githubusercontent.com/41094378/199877891-4ac80425-d980-4a0e-a19e-54fe5d19c74f.png) ![image](https://user-images.githubusercontent.com/41094378/199877934-e2ddac25-ba63-443b-b1dc-09c646f1c461.png) 我还有其他办法实现这种功能吗

好的,感谢你的付出! 但是npm仓库没有看见新版本0.2.1

但是真的沒有,淘宝npm镜像中也没有v0.2.1 ![image](https://user-images.githubusercontent.com/41094378/199921970-8f7f90ab-c421-47cb-a549-8ca7da9dd95e.png) `D:\vuecode\leaguetool>yarn add [email protected]` `yarn add v1.22.18` `warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix` `package managers...

Repository https://github.com/reactjser/vue3-virtual-scroll-list

> 我有一个类似的滚动问题。当我第一次渲染列表并调用 this.$refs.dynamicScrollerRef.scrollToBottom() 时。它首先将滚动呈现在顶部,然后滚动到底部,而不是呈现滚动已经在底部的列表。 > > 在添加列表中的所有项目后,我正在调用 this.$refs.dynamicScrollerRef.scrollToBottom() 。 Yes, I also encountered this problem, but I have solved it. You can view the repository I sent above. It helps...