Skip to content

Commit

Permalink
fix warning The watch property should be above the mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
Logorrheique committed Nov 4, 2024
1 parent 49a5272 commit ffa8aad
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/pages/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ export default {
components: {
MonitorList,
},
mounted() {
if (!this.$root.isMobile && this.$route.path === "/list") {
this.$router.push("/dashboard");
}
},
watch: {
"$root.isMobile"(newVal) {
if (!newVal && this.$route.path === "/list") {
this.$router.push("/dashboard");
}
}
}
},
mounted() {
if (!this.$root.isMobile && this.$route.path === "/list") {
this.$router.push("/dashboard");
}
},
};
</script>

Expand Down

0 comments on commit ffa8aad

Please sign in to comment.