08.02.2017 Views

vuejs

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

List Rendering 39<br />

36 writer: "John",<br />

37 upvotes: 8<br />

38 },<br />

39 {<br />

40 plot: "Someone ate my chocolate...",<br />

41 writer: "John",<br />

42 upvotes: 51<br />

43 },<br />

44 {<br />

45 plot: "I ate someone's chocolate!",<br />

46 writer: "Alex",<br />

47 upvotes: 74<br />

48 },<br />

49 ]<br />

50 }<br />

51 })<br />

52 <br />

53 <br />

Stories array ordered by upvotes.<br />

Hmmm, the array is ordered but this is not what we expected. We wanted the famous stories first.<br />

Luckily, again, orderBy filter accepts two arguments: the key to sort the array, and the order which<br />

specifies whether the result should be ordered in ascending (order >= 0) or descending (order <<br />

0) order.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!