[Vuejs]-The component runs on all pages without being called โ€“ Vue Nuxtjs

0๐Ÿ‘

I managed to solve it using the following

created(){
      this.serio = false;
      if (this.$route.path === '/whatsapp') {
        this.serio = true;
      }
    },
    watch: {
      async $route(to, from) {
          this.serio = false;
        if (this.$route.path === '/whatsapp') {
          this.serio = true;
        }
      }
    }

Leave a comment