2
I have this list as an object:
let app = new Vue({
el:'#app',
data:{
lista:{
nome: 'Nome Completo',
email: '[email protected]',
cpf: 'xxx.xxx.xxx-xx',
rg: 'x.xxx.xxx',
tel: '(xx) x xxxx-xxxx'
}
}
});
And I need to display in a td (in a single line) inside the tr and table. Example: Name: Full Name Email: [email protected] CPF: xxx.xxx.xxx-xx RG: x.xxx.xxx Tel: (xx) x xxxx-xxxx
But the closest I got was:
<table>
<tr>
<td v-for="(value, name, index) in lista">
{{name}}
{{value}}
</td>
</table>
Only this way the name (property) is within the same td as the value, but I need the property to occupy its own td and the value also.
try using template or a new component for v-for
– Sveen
I ended up putting two div inside the td, then I could organize better.
– Gustavo Rodrigues