使用element框架的icon時候,開發環境下是沒有問題的,打包完以后出現小方塊,頁面不顯示
解決辦法:找到utils.js文件,加 publicPath: '../../'
function generateLoaders (loader, loaderOptions) { const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] if (loader) { loaders.push({ loader: loader + '-loader', options: Object.assign({}, loaderOptions, { sourceMap: options.sourceMap }) }) } // Extract CSS when that option is specified // (which is the case during production build) if (options.extract) { return ExtractTextPlugin.extract({ use: loaders, fallback: 'vue-style-loader', publicPath: '../../',//解決ele小圖標出不來問題 }) } else { return ['vue-style-loader'].concat(loaders) } }