vue add new components

1, the target component is added in the views of the container

For example User.vue

2, the routing router.js

import User from './views/User.vue'

Then add routes

{

path:'/user',

name:'user',

component:User

}

3, came App.vue

添加<router-link to="/user">User</router-link>

 

 

Guess you like

Origin www.cnblogs.com/fan-1994716/p/11410242.html