vue入门之 路由.docx
1、安装 npm install vue-router --save 2、在main.js里引入 import router from './router' 3、配置路由 1创建组建引入组建 import Center from '@/views/Center' 2定义路由 const routes = [{ path: '/center', component: Center }, ] 3实例化VueRouter const router = new VueRouter({ routes }) 4挂载 new Vue