Cancelar vue converte automaticamente imagens em base64

Cancelar vue converte automaticamente imagens em base64

Por padrão, o vue converterá automaticamente pequenas imagens em base64 para uso, mas às vezes precisamos manter os atributos do arquivo original.

Modifique vue.config.jso arquivo e modifique o atributo url-loadernele paralimitfalse

Descrição oficial: https://v4.webpack.js.org/loaders/url-loader/

module.exports = {
    
    
  module: {
    
    
    rules: [
      {
    
    
        test: /\.(png|jpg|gif)$/i,
        use: [
          {
    
    
            loader: 'url-loader',
            options: {
    
    
              limit: false,
            },
          },
        ],
      },
    ],
  },
};

おすすめ

転載: blog.csdn.net/KimBing/article/details/131421572