fix warning The watch property should be above the mounted

This commit is contained in:
Logorrheique 2024-11-04 13:32:40 +01:00
parent 49a5272573
commit ffa8aad019

View file

@ -11,18 +11,19 @@ export default {
components: { components: {
MonitorList, MonitorList,
}, },
mounted() {
if (!this.$root.isMobile && this.$route.path === "/list") {
this.$router.push("/dashboard");
}
},
watch: { watch: {
"$root.isMobile"(newVal) { "$root.isMobile"(newVal) {
if (!newVal && this.$route.path === "/list") { if (!newVal && this.$route.path === "/list") {
this.$router.push("/dashboard"); this.$router.push("/dashboard");
} }
} }
},
mounted() {
if (!this.$root.isMobile && this.$route.path === "/list") {
this.$router.push("/dashboard");
} }
},
}; };
</script> </script>