get only the first 20 items in a backbone collection

后端 未结 1 1737
醉酒成梦
醉酒成梦 2021-02-19 04:21

I\'m trying to render only the first 20 items in a backbonejs collection.

If the collection was an array I would do _.first(collection, 20). But since it\'s not it doesn

相关标签:
1条回答
  • 2021-02-19 05:00

    Backbone collections have underscore methods builtin:

    collection.first(20)
    
    0 讨论(0)
提交回复
热议问题