I am playing with the vue.js library, and I am trying to make a change to the grid component example located here: http://vuejs.org/examples/grid-component.html
Sorting is interrupted when I add a space to one of the column names. See here: http://jsfiddle.net/greene48/9d1f0858/
The column name is passed through the sortBy function, which updates the sortKey variable, which is the column name, and switches the corresponding sortOrders key to -1 or 1.
sortBy: function (key) {
this.sortKey = key
this.sortOrders[key] = this.sortOrders[key] * -1
}
Does anyone know why this is not working? When I check the values โโof sortKey and sortOrders [key], they seem to be updated correctly. I think this should have something to do with not using the space in the built-in order in Vue.js. Therefore, it should break here:
<tr v-for="entry in data | filterBy filterKey | orderBy sortKey sortOrders[sortKey]">
<td v-for="key in columns">
{{entry[key]}}
</td>
</tr>
But I don't see anything in the Vue.js docs on how to fix this. Does anyone have any idea?
source
share