Vuejs: Event on route change

Vuejs: Event on route change

Asked on December 11, 2018 in vue.js.
Add Comment


  • 1 Answer(s)

    Build a watcher on $route in element:

    watch:{
        $route (to, from){
            this.show = false;
        }
    }
    

    It notices route modifications and when modified, sets shows false.

    Answered on December 11, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.