All render well until it reaches the object of the json parish .. I do not understand why it does not?
Because when I run the console.log brings me the correct data here I leave part of the code if anyone can help me .. Thank you very much
JSON:
{
"id": 1,
"cedula": "14748547",
"nombres": "Pepito",
"apellidos": "¨Pregunton",
"email": "pepitopregunton@gmail.com",
"telefono": "02128477447",
"direccion": "La Palomera",
"parroquia_id": 617,
"parroquia": {
"id": 617,
"parroquia": "BARUTA",
"municipio_id": 181,
"municipio": {
"id": 181,
"municipio": "BARUTA",
"estado_id": 13,
"estado": {
"id": 13,
"estado": "MIRANDA",
"activo": 0
}
}
},
"canaimas": [
{
"id": 1,
"modelo": "MG10T",
"deleted_at": null,
"activo": 1,
"pivot": {
"beneficiario_id": 1,
"canaima_id": 1,
"serial_canaima": "454DS5FDFD55",
"descripcion": "esta rayada"
}
},
{
"id": 6,
"modelo": "Canaima Docente VIT D2100",
"deleted_at": null,
"activo": 1,
"pivot": {
"beneficiario_id": 1,
"canaima_id": 6,
"serial_canaima": "kjdfbksjhgr43",
"descripcion": "NINGUNA"
}
}
]
}
html
×
Detalles
Cédula
Nombres
Apellidos
Email
Teléfono
Direccion
<textarea v-model="beneficiario.direccion" class="form-control" readonly="readonly" name="direccion"></textarea>
Estado
Municipio
Parroquia
| # |
Modelo |
Serial |
Descripción |
| @{{item.id}} |
@{{item.modelo}} |
@{{item.pivot.serial_canaima}} |
@{{item.pivot.descripcion}} |
vue.js
<script type="text/javascript">
new Vue({
el: '#beneficiario',
created: function () {
//this.showBeneficiario();
},
data: {
beneficiario: [],
errors: [],
},
methods: {
showBeneficiario: function (id) {
var url = 'beneficiario/'+ id;
axios.get(url).then(response => {
this.beneficiario = response.data;
$('#show').modal('show');
console.log(response.data.parroquia.parroquia);
console.log(response.data.parroquia.municipio.municipio);
console.log(response.data.parroquia.municipio.estado.estado);
});
}
}
});</script>
All render well until it reaches the object of the json parish .. I do not understand why it does not?
Because when I run the console.log brings me the correct data here I leave part of the code if anyone can help me .. Thank you very much
JSON:
{
"id": 1,
"cedula": "14748547",
"nombres": "Pepito",
"apellidos": "¨Pregunton",
"email": "pepitopregunton@gmail.com",
"telefono": "02128477447",
"direccion": "La Palomera",
"parroquia_id": 617,
"parroquia": {
"id": 617,
"parroquia": "BARUTA",
"municipio_id": 181,
"municipio": {
"id": 181,
"municipio": "BARUTA",
"estado_id": 13,
"estado": {
"id": 13,
"estado": "MIRANDA",
"activo": 0
}
}
},
"canaimas": [
{
"id": 1,
"modelo": "MG10T",
"deleted_at": null,
"activo": 1,
"pivot": {
"beneficiario_id": 1,
"canaima_id": 1,
"serial_canaima": "454DS5FDFD55",
"descripcion": "esta rayada"
}
},
{
"id": 6,
"modelo": "Canaima Docente VIT D2100",
"deleted_at": null,
"activo": 1,
"pivot": {
"beneficiario_id": 1,
"canaima_id": 6,
"serial_canaima": "kjdfbksjhgr43",
"descripcion": "NINGUNA"
}
}
]
}
html
Detalles
vue.js
<script type="text/javascript"> new Vue({ el: '#beneficiario', created: function () { //this.showBeneficiario(); }, data: { beneficiario: [], errors: [], }, methods: { showBeneficiario: function (id) { var url = 'beneficiario/'+ id; axios.get(url).then(response => { this.beneficiario = response.data; $('#show').modal('show'); console.log(response.data.parroquia.parroquia); console.log(response.data.parroquia.municipio.municipio); console.log(response.data.parroquia.municipio.estado.estado); }); } } });</script>