To sort a list by options select vuejs

Asked

Viewed 162 times

0

Good evening, I already asked this question, but I will try to improve it, I am developing in Aravel Vue and I just need to play the sorting function for the option within select, it is something simple, but I am not finding the problem, if anyone can help me thank you very much

inserir a descrição da imagem aqui

am calling function method inside th with v-on:click inserir a descrição da imagem aqui

only that I want to change it to the user set by the option in select, so: inserir a descrição da imagem aqui

And the code of it lies thus inserir a descrição da imagem aqui

and the logic is thus found inserir a descrição da imagem aqui

  • 3

    If you want to improve the question, simply edit the original question (rather than duplicate it). Also, if you want to improve, put the code as text and not as images (read the FAQ to better understand)

  • Solved as follows: <select v-model="ordemAuxCol" class="form-control mx-Sm-3"> <option v-on:click="orderColuna(index)" v-for="(title,index) in titles" :value="index" >{title}}</option> </select>

1 answer

-1

The v-for has to be within an option tag and this has to be within a select. And select has to be placed inside the th tag so you can realize an option selection format for column sorting.

And v-on:click has to reference each option triggering an action every click on each option.

At least, that’s what I got from your code.

See you later and good work, pal.

Browser other questions tagged

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