Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

使用JPG格式的图片时报错

       <img
        class="film-image"
        src="~@/assets/images/CT.JPG"
        alt=""
      >

image.png
jpg格式的文件就没问题,这还分大小写的?

网上查了下需要安装配置file-loader和url-loader,可是3.0的不知道怎么配置,vue.config.js文件的代码如下:

module.exports = {
    chainWebpack: (config) => {
        
        config.module.rule('images')
              .test(/.(png|jpe?g|JPG|gif|svg)(?.*)?$/)
              .use('url-loader')
              .loader('url-loader')
    }
}

不知道是不是我写的不对,还是说需要配置file-loader?其实就算不配置,别的格式的图片都可以,就这个JPG格式不行,vue cli 3.0的写法不太熟,请大佬指教。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
454 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...