Vue Router去掉url中默认的锚点#
2018-08-01 14:51
615 查看
hash模式url
vue-router默认hash模式――使用URL的hash来模拟一个完整的URL,于是当URL改变时,页面不会重新加载。
如果不想要这种默认的hash模式,可以用路由的history模式,这种模式充分的利用history.pushState API来完成URL跳转而无需重新加载页面。
index.js
Vue.use(Router) export default new Router({ mode: 'history', routes: [ { path:"/xxx", name:"xxx", component: Xxx, } ] })
history模式
修改之后url就变成了正常的url
总结
以上所述是小编给大家介绍的Vue Router去掉url中默认的锚点#,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
相关文章推荐
- 如何去掉Magento默认URL中的index.php
- 如何去掉Magento默认URL中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php
- 去掉php框架CI默认url中的index.php
- 如何去掉Magento默认URL中的index.php
- 如何去掉Magento默认URL中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php的步骤:
- 如何去掉Magento默认URL中的index.php
- 如何去掉Magento默认URL中的index.php
- 去掉CodeIgniter(CI)默认url中的index.php的步骤(完整版)
- 如何去掉Magento默认URL中的index.php
- 去掉highcharts右下角默认的网站url
- 去掉php框架CI默认url中的index.php
- CodeIgniter(CI)去掉默认url中的index.php
- 如何去掉Magento默认URL中的index.php
- 如何去掉Magento默认URL中的index.php
- 如何去掉Magento默认URL中的index.php
- 如何去掉Magento默认URL中的index.php
- 如何去掉Magento默认URL中的index.php