网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  v-router路由

v-router路由

分类: IT文章 • 2024-06-16 09:06:07

资料

// 这是必须要有的,不是会报错 
 Vue.use(VueRouter);
  const routes = [
    // 首页重定向goods组件
    { path: '/', redirect: 'goods' },
    { path: '/goods', component: goods },
    { path: '/ratings', component: ratings }
  ];
  const router = new VueRouter({
    routes // (缩写)相当于 routes: routes
  });

// 把router放到vue即可

const app = new Vue({
  router
}).$mount('#app')

相关推荐

  • python-Django路由传参
  • 03.DjangoURL路由
  • nuxt-相同目录下的多个动态路由跳转
  • 集线器、网桥、交换机、路由器区别的理解以及网络协议的理解
  • Vue 路由3种模式
  • 页面中路由的跳转与tab切换的效果差异及应用场景
  • vue跳转不存在路由返回404页面方法
  • mpvue 小程序常用的一些插件 路由跳转mpvue-router-patch,数据请求flyio,vuex
  • vue路由--网站导航功能
  • React 获取路由信息
  • [USACO19FEB]Cow Dating——找规律
  • Codeforces Round #426 (Div. 2)【A.枚举,B.思维,C,二分+数学】 A. The Useless Toy B. The Festive Evening C. The Meaningless Game
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号