B
B
badassstas2020-06-14 10:30:45
Vue.js
badassstas, 2020-06-14 10:30:45

How to take out duplicate content and show it as a brute force?

I'm starting to learn vue.js, I made a simple landing in which there is a block 5ee5d0718778e028605542.pngso as not to clog the layout, I put everything in a separate js file and set up the display by iterating over the array (I'm not sure how to explain it better) link to the code: https://jsfiddle.net/c5qm2Lsk / c logo and name came out, but with a problem rating. I understand that specifying several identical pngs in a row is very stupid, but I don’t know how else. Any significant comments (what is wrong and how is it right) on the code are welcome.
P.s. as long as it looks like this5ee5d214c804f632772570.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-06-14
@badassstas

The rating should not be a set of pictures, but a number. Depending on which, this or that picture will be shown a certain number of times:

<img v-for="i in 5" :src="i > ratingValue ? whiteStar : blackStar">

https://jsfiddle.net/cfvt6ka3/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question