I can’t access this.$http
in filters:
<v-sheet height="500">
<v-calendar :now="today" :value="today">
<template v-slot:day="{ date }">
<template v-for="event in eventsMap[date]">
<v-menu :key="event.Ref" full-width offset-x>
<template v-slot:activator="{ on }">
<div v-ripple v- v-on="on" >{{event | searchActivity}}</div>
</template>
</v-menu>
</template>
</template>
</v-calendar>
</v-sheet>
Here is my JavaScript code:
import Vue from "vue";
Vue.filter("searchActivity", function(val) {
var params = {
ProblemsID: val.ActivityRef
};
this.$http
.post(auth.API_URL + "api/Problems/Activity", params, {
headers: {
Authorization: "Bearer " + auth.getAuthHeader()
}
})
.then(
response => {
this.activityList = response.body;
},
response => {
if (response.Status === true) {
this.text1 = response.body.ResponseMessage;
this.snackbar = true;
} else {
this.text1 = response.statusText;
this.snackbar = true;
}
}
);
this.Obj = this.activityList.ActivityName;
return this.Obj;
});