为了账号安全,请及时绑定邮箱和手机立即绑定

vue-cli中history模式如何配置assetsPublicPath

vue-cli中history模式如何配置assetsPublicPath

ITMISS 2019-03-01 09:19:11
使用vue-router的history模式后,assetsPublicPath定位错误,有什么办法可以解决吗?// router 配置const HistoryTest = () => import('@/components/HistoryTest')Vue.use(Router)export default new Router({  mode: 'history',  routes: [    {      path: '/root/file',      name: 'HistoryTest',      component: HistoryTest,    },  ],})// HistoryText组件中<img src="static/logo.png" alt="">// 实际请求的URLRequest URL:http://localhost:48080/root/static/logo.png
查看完整描述

1 回答

?
精慕HU

TA贡献1845条经验 获得超8个赞

应该是<img src="static/logo.png" alt=""> ,少了个/


查看完整回答
反对 回复 2019-03-11
  • 1 回答
  • 0 关注
  • 3191 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号