vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

orderBy filter not working #404

Open Anshul-Batra opened 9 years ago

Anshul-Batra commented 9 years ago

Hi,

I am facing some issues in ordering a list in Vuejs. I am using orderBy filter with V-repeat.

Please find below the jsFiddle and let me know if i am doing something wrong

http://jsfiddle.net/533qod40/

Apart from this issue, i have one more query that when we assign some data to Vue object the we need to do this.$data=this.$data to render that data on view.. Why do we need to do this. because doing this will re-render all the object linked to Vue data and it can make app slow when big module is implemented using Vuejs

crswll commented 9 years ago

You need to use an array for orderBy as far as the documentation is concerned.

Also, you should also pass down the data from the parent to the child. You do not have to do things like this.$data = this.$data. Vue is reactive.

Anshul-Batra commented 9 years ago

But my requirement is to use v-repeat on an object... Because my object structure is like that...

And for this.$data=this.$data...you can check my jsfiddle...if i don't use it then its not getting updated in view