报'use' of undefined错
来源:12-1 Vue 3.0环境升级
qq_唯s彩_2
2021-05-26
import Vue from 'vue’
import Router from ‘vue-router’
//import Home from ‘…/pages/home/Home.vue’
//import City from ‘…/pages/city/City’
//import Detail from ‘…/pages/detail/Detail’
//Vue.use(Router)
Vue.use(Router)
export default new Router({
routes: [
{
path: ‘/’,
name: ‘Home’,
component: () => import(’…/pages/home/Home.vue’)
},
{
path: ‘/city’,
name: ‘City’,
component: () => import(’…/pages/city/City’)
},
{
path: ‘/Detail/:id’,
name: ‘Detail’,
component: () => import(’…/pages/detail/Detail’)
},
],
scrollBehavior (to ,from , savedPostition) {
return { x: 0 , y:0}
}
});
我复制了你线上的代码 还是会报 “Uncaught TypeError: Cannot read property ‘use’ of undefined” 的错
写回答
1回答
-
Dell
2021-05-26
看下你vue的版本是多少?
042021-05-31
相似问题