【vue2】vue2.0重复点击路由会报错
生活随笔
收集整理的這篇文章主要介紹了
【vue2】vue2.0重复点击路由会报错
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
vue2.0重復(fù)點(diǎn)擊路由會(huì)報(bào)錯(cuò)
router種index.js
import Vue from 'vue' import VueRouter from 'vue-router' import Home from '../views/Home.vue'//使用之后重復(fù)點(diǎn)擊路由不會(huì)報(bào)錯(cuò) // Vue.use(VueRouter) const VueRouterPush = VueRouter.prototype.push VueRouter.prototype.push = function push(to) {return VueRouterPush.call(this, to).catch(err => err) } // const routes = [{path: '/',name: 'Home',component: Home,}, {path: '/Profile',name: 'Profile',component: () => import('../views/profile.vue')},{path: '/Posts',name: 'Posts',component: () => import('../views/posts.vue')},{path: '/About',name: 'About',component: () => import('../views/About.vue')},{path: '/Test',name: 'Test',component: () => import('../views/Test.vue&總結(jié)
以上是生活随笔為你收集整理的【vue2】vue2.0重复点击路由会报错的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Ubuntu系统中编写c语言程序教程
- 下一篇: 公司要求会使用框架vue,面试题会被问及