Skip to content

Instantly share code, notes, and snippets.

@fredyfx
Created December 31, 2018 10:13
Show Gist options
  • Save fredyfx/90298d1db34c8c05062fb66447a27980 to your computer and use it in GitHub Desktop.
Save fredyfx/90298d1db34c8c05062fb66447a27980 to your computer and use it in GitHub Desktop.
Creando la tabla con elementos que llegaron desde el Json
<html>
<head>
<script src="~/lib/vue/vue.js"></script>
<script src="~/lib/vue-resource/vue-resource.js"></script>
</head>
<body>
<p>
Index!
</p>
<h1>Lista de productos</h1>
<div id="primervue">
{{titulo}}
</div>
<table id="segundovue" style="border-color: black; border-style: solid; border-width: 1px;">
<tr>
<td>Id</td>
<td>Nombre</td>
<td>Stock</td>
<td>¿Tiene Oferta?</td>
</tr>
<tr v-for="producto in productos">
<td>{{producto.id}}</td>
<td>{{producto.nombre}}</td>
<td>{{producto.stock}}</td>
<td>
<span v-if="producto.tieneOferta == true">Si</span>
<span v-else>No</span>
</td>
</tr>
</table>
<script src="~/scripts/wasap.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment