Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialOlga Isakova
5,349 PointsNote on event handling in Firefox
Hi,
Treasure said that we don't have to specify the event argument in the filterList method definition. This is true in Chrome, however, in Firefox it will result in a ReferenceError. Please correct me if I'm wrong, but we should add the argument in order for the code to work in Firefox:
filterList = function(event) {...}
See explanation here
Note that we don't need to add event in the v-on directive:
<select v-on:change="filterList">
Here, filterList(event) would result in another ReferenceError, as there is no event variable in the current scope.
P.S. Thanks for the fun and engaging course, Treasure Porth , you are an awesome teacher!
Steven Ventimiglia
27,371 PointsGlad to see that someone posted this before I did. Future course material for Vue.js should define this as a necessary step to take for browser cross-compatibility - not to mention that it's a fundamental rule for handling events in Vanilla JS.
2 Answers
Treasure Porth
Treehouse TeacherThanks for this, Olga! I've added this info to the Teacher's Notes for this video.
So happy to hear you enjoyed the course :D
Ross Horak
20,890 PointsAlso worth noting how to go about passing an argument to our v-on directive as well as still having access to the event object. Perhaps this will be good to include in teachers notes as well?
This stack overflow thread explains the problem and solution clearly: https://stackoverflow.com/questions/40956671/passing-event-and-argument-to-v-on-in-vue-js
nick black
5,578 Pointsnick black
5,578 PointsAwesome