SOURCE

console 命令行工具 X clear

                    
>
console
User = {props: ['id'], template: `<div>User {{id}} {{$route.params}}<div>`}


const router = new VueRouter({
  routes:[
    { path: '/:id', component: User, props: true }
  ]
})

router.beforeEach((to, from, next)=>{
    console.log(to, from)
    next()
})


const app = new Vue({
  router
}).$mount('#app')
<div id="app">
    
  <h1>Hello App!</h1>
  <p>
    <router-link to="/foo">Go to Foo</router-link>
    <router-link to="/bar">Go to Bar</router-link>
  </p>
  <router-view></router-view>
</div>

本项目引用的自定义外部资源