title: Vuejs axios get comments to load more
body: <p>I have a controller on php, where I return all comments. I have a code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>new Vue({
    el: ".vue",
    data() {
      return {
        reviews: [],
        commentsToShow: 2
      };
    },
    methods: {
        getComments() {
           axios.get('/api/comments').then(res =&gt; {
               this.reviews = res.data;
           });
        }
    }
    created() {
       this.getComments();  
    }
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.js"&gt;&lt;/script&gt;
  &lt;div class="container vue"&gt;
    &lt;div v-if="commentIndex &lt; reviews.length" v-for="commentIndex in commentsToShow"&gt; 
      &lt;div&gt;{{reviews[commentIndex].name}} says:&lt;/div&gt;
      &lt;i&gt;&lt;div&gt;{{reviews[commentIndex].description}}&lt;/div&gt;&lt;/i&gt;
      &lt;hr /&gt;
    &lt;/div&gt;
    &lt;button @click="commentsToShow += 2"&gt;show more reviews&lt;/button&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How I can with axios get only 2 comments, but not all comments. And when click on the button load more comments... Now from axios I get all comments, this is not good for perfomance. </p>