chore: fix example

This commit is contained in:
Evan You 2019-12-03 17:36:45 -05:00
parent 8ebb503f73
commit 27a72bd8f1

View File

@ -7,9 +7,9 @@
<tr> <tr>
<th v-for="key in columns" <th v-for="key in columns"
@click="sortBy(key)" @click="sortBy(key)"
:class="{ active: sortKey == key }"> :class="{ active: state.sortKey == key }">
{{ capitalize(key) }} {{ capitalize(key) }}
<span class="arrow" :class="sortOrders[key] > 0 ? 'asc' : 'dsc'"> <span class="arrow" :class="state.sortOrders[key] > 0 ? 'asc' : 'dsc'">
</span> </span>
</th> </th>
</tr> </tr>
@ -26,7 +26,7 @@
</script> </script>
<!-- DemoGrid component script --> <!-- DemoGrid component script -->
<script> <script>
const { reactive, computed } = Vue const { reactive, computed, toRefs } = Vue
const capitalize = str => str.charAt(0).toUpperCase() + str.slice(1) const capitalize = str => str.charAt(0).toUpperCase() + str.slice(1)
@ -71,7 +71,7 @@ const DemoGrid = {
} }
return { return {
...state, state,
filteredData, filteredData,
sortBy, sortBy,
capitalize capitalize