vue-router의 기본 사용

1524 단어 Vue 학습vue.js



    
    Title
    
    


    
Vue.use(VueRouter); var Login = { template:` <div> </div> ` }; var Register = { template:` <div> </div> ` }; var router = new VueRouter({ // routes:[ // { path:"/login", component:Login }, { path:"/register", component: Register } ] }); var App = { template: ` <div> <router-link to="/login"> </router-link> <router-link to="/register"> </router-link> <router-view></router-view> </div> ` }; new Vue({ el:'#app', data(){ return{} }, components:{ App:App }, template:`<App />`, router:router// router vue });

좋은 웹페이지 즐겨찾기