page has a switch, using the vue switch switch component, which can be used in Google browser, but Firefox is not compatible. An error is reported under Firefox "event is not defined"
.Vue.component ("tMutual switchgear, {
)props: {
itemData: {
type: Object,
default: function () {
return {
}
}
}
},
template: `<div class="switch switch-inline" style="height: 20px">
<input type="checkbox" v-model="switch.is_open" v-on:change="switchClick(itemData)">
<label></label>
</div>`,
methods:{
switchClick:function (row) {
var el = event.currentTarget;
if (el.checked) {
status = 1
} else {
status = 2
}
TourismLoading.show();
$.get("url", {
id: row.id,
is_open: status
}, function (request) {
TourismLoading.hide();
if (parseInt(request.code) === 0) {
success("");
} else {
error(request.message);
return false;
}
})
}
},
computed:{
switch(){
var _self = this;
if(_self.itemData.is_open == 2){
_self.itemData.is_open = 0;
}
return _self.itemData;
}
}
});
how can we make him compatible? after trying some methods on the Internet, we can"t all