0
Good afternoon,
I need to display the details of a certain class by clicking on a button, passing only the code. In the Index code, I did basically this way:
<button type="button" class="btn btn-sm btn-primary" v-b-tooltip title="Detalhes" @click="openDetalhes({ turmaId: item.turmaId })">
<i class="fa fa-search"></i>
</button>
And in VUE methods:
openDetalhes: function (model) {
this.showLoading();
new Api('/turma/details').get(model).then(data => {
this.result.item = data.data;
this.hideLoading();
}, (err) => {
this.failLoading();
if (err && err.data && err.data.errors) {
this.$eventHub.$emit('show-notidication', {
type: 'error',
title: 'Atenção',
text: err.data.errors[0]
})
}
});
//this.$router.push({ path: '/turma/details' });
},
The call is hitting the controller correctly, but the detail page is not being displayed.
Your event is spelled correctly?
show-notidication
, looks like a typo.– Danizavtz
really was with error of spelling, but it remains the same thing
– Fábio André Campos da Cruz
Could you add what the path call of the api should look like? It would be
/turma/details/:id
? Example:/turma/details/1
?– Danizavtz
I didn’t understand why the tag
c#
– Ricardo Pontual
introduce your controller
– Leandro Angelo