Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement