I'm encountering an issue with my Vue script in PhpStorm. Despite setting the variable redirect_to
, I am getting an Unresolved variable syntax error during debugging. Please refer to the image below for further information. How can I resolve this problem?
<script>
const timeToRefetch = 2000;
let intervalRef;
const homePageUrl = "/";
let messageCount = 0;
var app = new Vue({
el: "#app",
data: {
status: "",
message: "",
redirect_to: ""
},
created() {
const refThis = this;
intervalRef = setInterval(() => {
fetch(ApiUrl)
.then(response => response.json())
.then(repos => {
refThis.status = repos.status;
this.message = repos.message;
clearInterval(intervalRef);
setTimeout(() => {
window.location.href = repos.redirect_to;
}, 3000);
},
);
}, timeToRefetch);
}
});
</script>