As we wrote the code while we were figuring out the problem, there comes a point when you need to take a step back and look at your code to optimize it. This could include reducing the number of variables and methods or creating methods, to reduce repeating functionality. Our current Vue app looks like the following:
const app = new Vue({
el: '#app',
data: { people: [...],
currency: '$',
filterField: '', filterQuery: '', filterUserState: '' }, methods: { activeStatus(person) { return (person.isActive) ? 'Active' :
'Inactive'; },
activeClass(person) { return person.isActive ? 'active' :
'inactive'; }...