码迷,mamicode.com
首页 > 其他好文 > 详细

vue-router 去掉#

时间:2019-02-18 23:19:45      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:url   pre   vuerouter   new   需要   lan   mode   script   target   

vue-router 默认的路由模式是hash,我们要去掉url中的#需要将路由模式切换为history

const router = new VueRouter({
    mode : ‘history‘
});

  至于去掉#之后会产生什么问题,可以参考这篇内容:

https://www.cnblogs.com/hanshuai/p/9930063.html

vue-router 去掉#

标签:url   pre   vuerouter   new   需要   lan   mode   script   target   

原文地址:https://www.cnblogs.com/carriezhao/p/10398315.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!