0
I have this html code (I have a script tag in the head that prompts Vue already)
<table class="table-striped" id="productsTable">
<thead>
<tr>
<th>Nome</th>
<th>Preço</th>
<th>Descrição</th>
</tr>
</thead>
<tbody>
<tr v-for="product in products">
<td>
{{ product.name }}
</td>
<td>
{{ product.value }}
</td>
<td>
{{ product.description }}
</td>
</tr>
</tbody>
</table>
<script>
var read = require('read-file-utf8');
var loki = require('lokijs');
var db = new loki('db.json');
var data = read(__dirname + "/db.json");
db.loadJSON(data);
var products = db.getCollection('products');
new Vue({
el: 'body',
data: {
products: []
},
ready: () => {
this.products = products.data;
}
});
require('./render.js');
</script>
Can someone tell me why it doesn’t work??