hilongjw / vue-recyclerview

Mastering Large Lists with the vue-recyclerview
https://hilongjw.github.io/vue-recyclerview/
MIT License
1.45k stars 121 forks source link

Suport for multiple tombstone templates #13

Open Textras opened 7 years ago

Textras commented 7 years ago

Hello! This looks awesome btw. Great work.

Our list contains multiple templates and we currently use if statements to render different variations. Here is how our out current template markup looks like:

(example can be viewed here: https://codepen.io/Peety/pen/qmgZzE?editors=1010)

Here is our current template:

  • Me: {{item.keyword}}
    Near: {{item.address}}
    {{item.name}}
    {{item.address}} ({{convertDistance(item.distance)}})
    @{{item.handle}}
    {{item.message.text}}
    {{item.checkInAddress.address}}
    {{convertDistance(item.distance)}}
  • As you can see we have several distinct item markups. We've tried to implement the recycler view but with the app either crashes or the feed does not render render. Any ideas why?

    Looking at how a React component handles infinite scrolling (below), I wonder if there is a prop we can use for vaiable tombstone height to prevent mem issues that may be cause of crash. https://github.com/orgsync/react-list see the itemSizeEstimator(index, cache) https://github.com/seatgeek/react-infinite (passing an array of height estimates) https://github.com/Radivarig/react-infinite-any-height

    Thanks for any help!

    ...btw good resources we found helpful for anyone looking into RecyclerView 1) https://medium.com/@talkol/recycling-rows-for-high-performance-react-native-list-views-628fd0363861 (ReactNative but a good rundown) 2) https://github.com/bvaughn/react-virtualized/issues/25