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
      });
    }
  }
});
Phil
  • 128,310
  • 20
  • 201
  • 202
Mithun Jack
  • 171
  • 8
  • 1
    https://stackoverflow.com/questions/48980865/vue-js-difference-of-data-return-vs-data – ßiansor Å. Ålmerol Jun 27 '19 at 05:15
  • 1
    A good read [would be here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions). 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. – Ohgodwhy Jun 27 '19 at 05: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. – Laurent S. Jun 27 '19 at 05:51

0 Answers0