You are right, should have posted a jsfiddle sorry.
However i fixed it.
router-view had a v-if that i was using to alternate between itself and a loading component.
Moving from v-if to v-show solved the problem.
You are right, should have posted a jsfiddle sorry.
However i fixed it.
router-view had a v-if that i was using to alternate between itself and a loading component.
Moving from v-if to v-show solved the problem.
You are right, should have posted a jsfiddle sorry.
However i fixed it.
router-view had a v-if that i was using to alternate between itself and a loading component.
Moving from v-if to v-show solved the problem.
Hi everyone,
i have the following async function:
signIn: async function() {
try {
this.$emit("setLoading");
let response = await axios.post("http://localhost:3000/signIn", {
usernameOrEmail: this.usernameOrEmail,
password: this.password
});
switch (response.status) {
case 200:
this.$router.push("/List");
break;
default:
break;
}
} catch (error) {
this.$q.notify({
type: "negative",
message: `Something went wrong. ${error}`
});
} finally {
this.$emit("loadingCompleted");
}
}
These 2 events are being used by the router-view:
<router-view
@setLoading="setLoading"
@loadingCompleted="loadingCompleted"
/>
setLoading: function() {
alert("setLoading");
},
loadingCompleted: function() {
alert("loadingCompleted");
},
In this case the first emit (“setLoading”) gets called and the alert appears, however when the 2nd emit gets called nothing happens; no error in console and no alert printed. Same if i use console.log instead of alert.
However if i remove the axios call everything seems to work fine.
Anyone has any idea of what could be causing this?