View class detail

Asked

Viewed 25 times

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.

  • really was with error of spelling, but it remains the same thing

  • Could you add what the path call of the api should look like? It would be /turma/details/:id? Example: /turma/details/1?

  • 1

    I didn’t understand why the tag c#

  • introduce your controller

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.