title: VUEJS remove added routes or clear added routes
body: <p>Good Day Everyone,</p>
  
  <p>I'm trying to remove the addedRoutes on vuejs.. after doing hours of research on vue-router documentation I can't find a method that can clear the addedRoutes.</p>
  
  <p><strong>Here's my code:</strong></p>
  
  <pre><code>new Vue({
    el: '#app',
    render: h =&gt; h(App),
    router:router,
    data(){
        return{
            isAuth:null
        }
    },
    created(){
  
          this.checkAuthentication();
          if(this.isAuth){
              this.getUserRole();
          }
          bus.$on('reload', (passData) =&gt; {
              this.getUserRole();
              if(this.isAuth){
                 this.getUserRole();
              }
          });
    },
    methods:{
        getUserRole(){
            this.$http.get('api/users/getRole').then(response =&gt; {
                console.log(response);
                if(response.body.is_admin){
                  router.addRoutes(Routes);
                }else if(response.body.is_buh){
                  router.addRoutes(BUHRoutes);
                }else if(response.body.is_so) {
  
                }
            });
        },
        checkAuthentication(){
            this.isAuth = this.$auth.isAuthenticated();
        }
    }
  });
  </code></pre>
  
  <p>my scenario is that when I login and if it is successful I get the userRole and based on that user role I add the routes <code>router.addRoutes()</code> based on the userRole. however, when I logout I get this warning on my console log <code>[vue-router] Duplicate named routes definition: { name: "division-maintenance", path: "/division-maintenance" }</code>. that's why I was doing a research on how to clear the addedRoutes.</p>
  
  <p>any help will be appreciated.</p>