VueJS sum pivot table
<p>I am learning VueJS and am in the process of porting a very simple app I wrote in Laravel with blade as the template engine.</p>

<p>I am keeping the existing back end which consists of a simple restful api of 3 tables: Books, Places and a pivot Books_Places.</p>

<p>The json looks something like this:</p>

<pre><code>books:
{
  "id": 1,
  "title": "foo bar",
  "places": [
    {
      "id": 1,
      "name": "library 1",
      "pivot": {
        "book_id": "1",
        "place_id": "1",
        "quantity": "50",
        "id": 1
      }
    },
    {
      "id": 2,
      "name": "library 2",
      "pivot": {
        "book_id": "1",
        "place_id": "2",
        "quantity": "75",
        "id": 2
      }
    }
  ]
}
</code></pre>

<p>In blade I had the following line built into a "for book in books" cycle which I loved because of its simplicity:</p>

<pre><code>{{ $book-&gt;places-&gt;sum('pivot.quantity') }}
</code></pre>

<p>I am trying to accomplish the same in VueJS but not sure what the simplest approach is, I'd appreciate your opinions.</p>

<p>Thanks!</p>