Go back to Examples

Sort collection list

CMS - Intermediate

The sort method allows you to sort a collection list by a field. You can also sort by ascending or descending order.

                <template v-for="post in posts.sort(sortByProp.bind(null, 'name', {ascending: false}))">
    <h1 v-html="post.name"></h1>
</template>