vue3-virtual-scroll-list
vue3-virtual-scroll-list copied to clipboard
How to catch an events that was emitted from an item component?
There the way exists for pass params TO items components via "source" item prop, or pass additional params to items components: via extra-props. But how to get BACK a data from an item components?
- How to catch an events that was emitted from an item component?
- How to get item component instance with an index or data-key specified? Or, for example, to detect is the item in the visible scroll area (get the items bound rect within the browser window)
你可以使用一个中间组件,不需要把需要渲染的组件传递给他
你可以使用一个中间组件,不需要把需要渲染的组件传递给他 I don't understand Сhinese, sorry. I tried to translate your answer, but it does not explain the attached pictures. I think, if you want, that most of people clear understand you, try write in English (it's not my native language too, but I do so).
If I clear uderstand your code on screens, you suggest to use a Vuex global store. This approach is not a good one, as I think. It breaks modularity and increases the connectivity of components. Vue recommends to use "props - emit" scheme to comunicate parent component with its children components. And I don't see how to use this scheme with this realization of Virtual Scroller.
你可以使用一个中间组件,不需要把需要渲染的组件传递给他 I don't understand Сhinese, sorry. I tried to translate your answer, but it does not explain the attached pictures. I think, if you want, that most of people clear understand you, try write in English (it's not my native language too, but I do so).
If I clear uderstand your code on screens, you suggest to use a Vuex global store. This approach is not a good one, as I think. It breaks modularity and increases the connectivity of components. Vue recommends to use "props - emit" scheme to comunicate parent component with its children components. And I don't see how to use this scheme with this realization of Virtual Scroller.
Hi @vvy6791 , find solution here: https://github.com/tangbc/vue-virtual-scroll-list/issues/237#issuecomment-641935872 both vue and vue3 have extra-props, it works for me