publicPath 属性设置无效
作者: jfornior创建于 2024年12月18日更新于 2025年11月2日
module.exports = { publicPath: process.env.NODE_ENV === 'production' ? '././' : '/' } In the electron+vue project, the publicPath property is configured. When setting the background image in CSS, the URL of the image used is url('../../assets/img/login-logo.jpg') no-repeat;. After packaging, the image path is url(app:///img/login-bg.00552e69.png), which causes the file to be not found. As a result, the element-ui icons cannot be used properly.
内容来源: vuejs/vue-cli