Most product catalogs won't just contain ways of filtering their product list, but also ways of sorting it as well. Luckily for us, the sorting side is a lot simpler than the filtering side. We're going to add a very simple sort component that follows the same theme of pushing the user's selected value into the URL query object. We'll then make sure our product list abides by the selected sort property and direction using computed properties.
Client-side sorting
Building a sort component
Start by creating a ClientApp/components/catalogue/ProductSort.vue file, and add a template section with the following content:
<template>
<div>
<span class="label mr-2">Sort by</span...