Vuejs event not working in firefox - fine in Chrome Vuejs event not working in firefox - fine in Chrome vue.js vue.js

Vuejs event not working in firefox - fine in Chrome


Firefox doesn't have a global event object.

WebKit follows IE's old behavior of using a global symbol for "event", but Firefox doesn't.

Simply add it as a parameter.

methods: {  filterPeople: function filterPeople(event) {    $(event.target).closest('li').addClass('active');  }}


You must pass the event as parameter, should be :

methods: {  filterPeople: function(event) {    $(event.target).closest('li').addClass('active');  }}

NOTE : The name was duplicated in the function definition.

Hope this helps.


Pass event to function filterPeople(). Like this:

methods: {  filterPeople: function filterPeople (e) {  $(e.target).closest('li').addClass('active');});