0

I am from PHP background and a newbie to js languages. Generally programmers use '=>' operator to key/value exchange in coding. But in vue js, it is little bit confusing or can't I understand the same array thing? or how it can be understood? I haven't pasted the seed.js. Just assume it has array.

<article v-for="tubmission in sortedSubmissions"
         v-bind:key="tubmission.id" class="media">
new Vue({
  el: '#app',
  data: {
    tubmissions: Seed.submissions
  },
  computed: {
    sortedSubmissions () {
      return this.tubmissions.sort((a, b) => {
        return b.votes - a.votes
      });
    }
  }
});
3
  • 1
    stackoverflow.com/questions/48980865/… Commented Jun 27, 2019 at 5:15
  • 1
    A good read would be here. But in your particular situation, it's that the fat arrow is preserving the scope of this to your component, as opposed to the window. Commented Jun 27, 2019 at 5:41
  • If this is too much hatered for you, there are plenty of resources out there where you can hopefuly find very kind answers to your questions... here people are supposed to do some research before asking. Commented Jun 27, 2019 at 5:51

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.