router

vue-router 快速入门

Vue
总计 548 字
配置路由 $ npm install vue-router --save routes.js import Home from './pages/Home.vue' import Gifs from './pages/Gifs.vue' import User from './pages/User.vue' export const routes = [ { path: '', component: Home }, { path: '/gifs', component: Gifs }, { path: '/user/:id', component: User } //指定路由和对应要渲染的组件 //404的path