Answer the question
In order to leave comments, you need to log in
In general, there is a skills block with percentages, how can you display a line by the number of percentages through vue?
there is such a code
as through vue you can draw a line
knowing the number of percent
<ul>
<li>PHOTOSHOP 88%</li>
<li>ILLUSTRATOR 92%</li>
<li>SKETCH 90%</li>
<li>AFFTER EFFECTS 98%</li>
</ul>
Answer the question
In order to leave comments, you need to log in
First, let's describe the elements of the list as an array of objects, where text and percentage will be separate properties:
items: [
{ name: "PHOTOSHOP", percent: 88 },
{ name: "ILLUSTRATOR", percent: 92 },
{ name: "SKETCH", percent: 90 },
{ name: "AFFTER EFFECTS", percent: 98 },
],
border-bottom
for example):methods: {
getStyle: item => ({
'border-bottom': `3px solid ${item.color}`,
width: `${item.val}%`,
}),
},
<ul>
<li
v-for="item in items"
:style="getStyle(item)"
>
{{ item.name }} {{ item.percent }}%
</li>
</ul>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question