mode:'history'
来源:5-4 vue-router(设置路由)

王耶啵的肖兔兔
2017-08-17
没有设置mode的时候,路由换页面是正常的,设置为“history”之后,没有hash了 但是页面的内容也不换了
import Vue from 'vue' import Router from 'vue-router' import Rule from '@/components/Rule' import idVerification from '@/components/id_verification' import infoCollection from '@/components/info_collection' import imgCollection from '@/components/img_collection' Vue.use(Router) export default new Router({ mode: 'history', routes: [ { path: '/', name: 'Rule', component: Rule }, { path: '/id_verification', name: 'id_verification', component: idVerification }, { path: '/info_collection', name: 'info_collection', component: infoCollection }, { path: '/img_collection', name: 'img_collection', component: imgCollection } ] })
还有 最上面import那部分 老师在视频里的路径都是"./" 可是我把这里的“@/”改成“./”就报错这是为什么呢
写回答
2回答
-
_流水不腐
2018-01-06
你好 你的问题解决了么?请问答案是?
00 -
fishenal
2017-08-21
@是根目录的代码
042017-08-23
相似问题