I have an array of objects in my Vue instance which consist of data from a MongoDB server, and an array of numbers which represents weeks. The Arrays looks like this:
courses: [
{Course: "A" Week: "1"},
{Course: "B" Week: "1"},
{Course: "A" Week: "2"},
{Course: "B" Week: "2"}
],
weeksInSemester: [1,2,3]
I display my data with ejs like this:
<div v-for="value in courses">
{{ value.Course }}
</div>
So far so good. Now I want to be able to filter the results from an tag like this:
<select>
<option v-for="weeks in weeksInSemester">
{{ weeks }}
</option>
</select>
I have been working/looking around for some time now, and not been able to find any solutions. What would be the best way to do this?