Answer the question
In order to leave comments, you need to log in
How to add pictures to vue array?
Hello, I'm learning vue and now I decided to make my first application. I want to make a "School timetable" application. The bottom line is that there is a field where the subject is entered. The button is pressed and the item appears in the schedule.
I implemented this functionality, but now I want the calculator icon to appear in the schedule when entering a subject, for example, "mathematics".
Please suggest how to implement this.
Answer the question
In order to leave comments, you need to log in
For example like this:
- make an object with the name of the object and the corresponding icon
let icons = {
"math": "icon_name",
"physic": "icon_name_2"
}
let subject = 'math';
console.log(icons[subject])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question