D
D
danilr2019-11-21 13:29:23
Laravel
danilr, 2019-11-21 13:29:23

How to make priority logic in laravel + vue?

From the back, I get an object from different fields, among which there are boolean values ​​like 'height: "120m"'.
And I immediately display them in the layout like this . And these are 5 blocks. I need to show only three of the five. In my priority. There can be 1 and 4 and 5 of them, but you need to output >= 5 values. The question is how to do this in laravel? I also use Vue on this template, if anything. <div>{{data.height}}</div>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gian_tiaga, 2019-11-21
@gian_tiaga

Get an order field of type integer, set its values ​​in the required order and sort by it directly when selecting from the database

P
pavelpolitaev, 2019-11-21
@pavelpolitaev

Show in full one response from the server and what priority you want to filter by. I don't see a problem at all. If you need to filter data before passing it to the Vue template, make a computed property and do filtering there and pass this property to for in the template

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question