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

使用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="">


// 实际请求的URL

Request URL:http://localhost:48080/root/static/logo.png


ITMISS
浏览 3216回答 1
1回答

精慕HU

应该是<img src="static/logo.png" alt="">&nbsp;,少了个/
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript