How to pass results from db query to Vue?
<p>I have an API request that calls a SQL query within the function. I am trying to pass the results to a .vue page. (Using express-vue) Here is the api request  </p>

<pre><code>router.get('/search', (req, res, next) =&gt; {

    var keyword = ("%" + req.query.keyword + "%")
    var lat = req.query.lat
    var lng = req.query.lng

    console.log(keyword, lat, lng)

    connection.query('SELECT *, ( 3959 * acos (cos ( radians(?) )* cos( radians( lat ) )* cos( radians( lng ) - radians(?) )+ sin ( radians(?) )* sin( radians( lat ) ))) AS distance FROM job_posting where job_title like ? HAVING distance &lt; 25', [
        lat, lng, lat, keyword
    ], function(err, rows) {

     })
  res.render('main', {
  // data: {
  //           results
  //         },
    vue: {
        meta: {
            title: 'Page Title',
        },
        components: ['myheader', 'myfooter', 'searchform', , 'results']
    }

});
})
</code></pre>

<p>and the Main.vue page  </p>

<pre><code>&lt;template&gt;
&lt;div id="wrap"&gt;
    &lt;div class="col-md-1"&gt;&lt;/div&gt;
    &lt;div id="main-container" class="container col-md-10"&gt;

        &lt;myheader&gt;&lt;/myheader&gt;
        &lt;div class="col-md-4"&gt;&lt;/div&gt;
        &lt;div class="col-md-4"&gt;
        &lt;searchform&gt;&lt;/searchform&gt;
        &lt;results&gt;&lt;/results&gt;


        &lt;/div&gt;
        &lt;div class="col-md-4 text-center"&gt;

        &lt;/div&gt;
        &lt;div class="col-md-1"&gt;&lt;/div&gt;


    &lt;/div&gt;
&lt;/div&gt;
&lt;/template&gt;
</code></pre>

<p>Im trying to pass the data to this component results.vue</p>

<pre><code>&lt;template&gt;

&lt;p&gt;Display data&lt;/p&gt;

&lt;/template&gt;

&lt;script&gt;
export default {
    data: function () {
        return {
            // dogs: 3
        }
    }
}
&lt;/script&gt;

&lt;style lang="css"&gt;
&lt;/style&gt;
</code></pre>

<p>How do I pass the "rows" data to the results.vue page?  </p>

<p>here is how the data is coming from the DB  </p>

<pre><code>[ RowDataPacket {
    id: 1,
    job_title: 'Software Engineer',
    job_desc: '&lt;p&gt;Ayo&lt;/p&gt;',
    location: 'Akron, OH',
    job_type: 'Full-Time',
    salary: '',
    date_created: 2016-11-23T05:00:00.000Z,
    short_desc: 'yyoyo@gmail.com',
    apply_url: 'Ayo',
    lat: '41.084821',
    lng: '-81.515607',
    distance: 0 },
  RowDataPacket {
    id: 2,
    job_title: 'Software Engineer',
    job_desc: '&lt;p&gt;Ayo&lt;/p&gt;',
    location: 'Akron, OH',
    job_type: 'Full-Time',
    salary: '',
    date_created: 2016-11-23T05:00:00.000Z,
    short_desc: 'yyoyo@gmail.com',
    apply_url: 'Ayo',
    lat: '41.084821',
    lng: '-81.515607',
    distance: 0 },
  RowDataPacket {
    id: 3,
    job_title: 'Software Engineer',
    job_desc: '&lt;p&gt;Ayo&lt;/p&gt;',
    location: 'Akron, OH',
    job_type: 'Full-Time',
    salary: '',
    date_created: 2016-11-23T05:00:00.000Z,
    short_desc: 'yyoyo@gmail.com',
    apply_url: 'Ayo',
    lat: '41.084821',
    lng: '-81.515607',
    distance: 0 } ]
</code></pre>