Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.99 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.   <meta charset="UTF-8">
  5.   <title>Document</title>
  6.   <!-- Bootstrap CSS 4.3.1 -->
  7.   <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  8.  
  9.   <!-- Axios -->
  10.   <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  11.  
  12.   <!-- VueJS -->
  13.   <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  14. </head>
  15. <body>
  16.   <div class="container mt-4" id="app">
  17.  
  18.     <table class="table table-bordered">
  19.       <thead>
  20.         <tr>
  21.           <th scope="col">#</th>
  22.           <th scope="col">Marca</th>
  23.           <th scope="col">Modelo</th>
  24.           <th scope="col">Polifonía</th>
  25.           <th scope="col">VCA</th>
  26.           <th scope="col">Efectos</th>
  27.           <th scope="col">Teclado</th>
  28.           <th scope="col">Memoria</th>
  29.           <th scope="col">Precio</th>
  30.         </tr>
  31.       </thead>
  32.       <tbody>
  33.         <tr v-for="sintetizadores, index in users">
  34.           <th scope="row">{{ index + 1 }}</th>
  35.           <td>{{ sintetizadores.marca }}</td>
  36.           <td>{{ sintetizadores.modelo }}</td>
  37.           <td>{{ sintetizadores.polifonia }}</td>
  38.           <td>{{ sintetizadores.VCA }}</td>
  39.           <td>{{ sintetizadores.efectos }}</td>
  40.           <td>{{ sintetizadores.teclado }}</td>
  41.           <td>{{ sintetizadores.memoria }}</td>
  42.           <td>{{ sintetizadores.precio }}</td>
  43.         </tr>
  44.       </tbody>
  45.     </table>
  46.   </div>
  47.   <script>
  48.     var app = new Vue({
  49.       el: '#app',
  50.       data: {
  51.         users: []
  52.       },
  53.       mounted: function() {
  54.         axios.get('http://localhost:3000/sintetizadores')
  55.             .then(response => {
  56.               this.users = response.data;
  57.               console.log(response);
  58.             })
  59.             .catch(error => {
  60.               console.log(error);
  61.             });
  62.       }
  63.     })
  64.   </script>
  65. </body>
  66. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement