How to use addroutes method in Vue-router?
I have created a function "addroute()" to add routes dynamically,but it didn't work(the router does not changed). Is this a right way to use addRoutes method? I have learned this from tutorial. If not then give me a correct example,Thanks! ... const Bar={ template:'#panels', data(){ return {title:'badss'} } }; const Foo={ template:"#panels", data(){ return {title:'hell'} } }; const router = new VueRouter({ routes:[ {path:'/foo',component:Foo}, {path:'/bar',component:Bar} ] }); new Vue({ el:'#root', router:router, data:{ stats:stats }, methods: { // }, }); function addroute(){//watch here