Skip to content

Instantly share code, notes, and snippets.

@dario61081
Last active July 16, 2019 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dario61081/06aefc56f4340ee1cf64c12fe991135c to your computer and use it in GitHub Desktop.
Save dario61081/06aefc56f4340ee1cf64c12fe991135c to your computer and use it in GitHub Desktop.
vue.js render multiple tr
<template v-show="datos" v-for="item, index in datos">
<tr :key="index">
<td class="date">[[item.fecha|todate]]</td>
<td>[[item.numero]]</td>
<td class="codigo">[[item.cuenta_codigo]]</td>
<td class="text-ellipsis" :title="item.descripcion">[[item.descripcion]]</td>
<td class="number">[[item.cotizacion|tonumber]]</td>
<td class="number">[[item.debe1|number]]</td>
<td class="number">[[item.haber1|number]]</td>
<td class="number">[[item.debe2|tonumber]]</td>
<td class="number">[[item.haber2|tonumber]]</td>
</tr>
<template v-if="datos[index+1]">
<tr v-if="datos[index+1].numero > datos[index].numero">
<td colspan="100"><i class="tag icon"></i>[[item.observacion]]</td>
</tr>
</template>
<template v-if="index===(datos.length-1)">
<tr>
<td colspan="100"><i class="tag icon"></i>[[item.observacion]]</td>
</tr>
</template>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment