1、template
<img src="@/assets/image/login/title.png" alt="">
// 渲染後html頁面
<img src="/static/img/title.1e9fa570.png" alt="">
2、style
/* 圖檔路徑 src/assets/image/bg-index.jpg */
background: url(~@/assets/image/bg-index.jpg)
/* 渲染後 */
background: url(/static/img/bg-index.e4bde37c.jpg)
參考
詳解vue中靜态資源的路徑問題(深度好文)