Currently, I am in the process of integrating Vue.js into my project step by step, particularly for data binding purposes. To achieve this, I have included the Vue.js script in the footer and created a main.js file to house my Vue scripts.
One of the challenges I am facing is sorting a data list by date using a dropdown select option that provides date ranges. Despite searching online for tutorials, I have yet to find a solution that aligns with my requirements. Could someone offer guidance on how to accomplish this task?
<div id="date-range">
<h3>Activity Overview</h3>
<select id="selected" class="activity-overview__select" v-model="selected">
<option value="24hr">Past 24 Hours</option>
<option value="7days">Past 7 Days</option>
<option value="14days">Past 14 Days</option>
</select>
<ul>
<li>{{ selected.id }}{{ selected.text }}{{ selected.date }}</li>
</ul>
</div>
var incidentCount = new Vue({
el: '#incidentCountID',
data: {
incidentList: [
{ id: 0, text: 'Run', date: '2018-07-11' },
{ id: 1, text: 'Jump', date: '2018-07-10' },
{ id: 2, text: 'Skip', date: '2018-07-06' },
{ id: 3, text: 'Dance', date: '2018-07-05' },
{ id: 4, text: 'Swing', date: '2018-07-01' },
{ id: 5, text: 'Hop', date: '2018-05-29' },
{ id: 6, text: 'Bounce', date: '2018-06-29' },
{ id: 7, text: 'Crawl', date: '2018-06-27' },
{ id: 8, text: 'Walk', date: '2018-06-26' },
{ id: 9, text: 'Spin', date: '2018-06-25' },
{ id: 10, text: 'Skate', date: '2018-06-07' },
{ id: 11, text: 'Hike', date: '2018-06-05' }
]
},
methods: {
???
}
});
Any assistance would be greatly appreciated!