我的某些图标具有以下CSS:

ul.grid-list li.input-grid-box input.input.consumption {
    background: url(../img/icons/icon-consumption.png) no-repeat scroll 3px 14px;
    background-size: 21px;
}
ul.grid-list li.input-grid-box input.input.workforce {
    background: url(../img/icons/icon-workforce.png) no-repeat scroll 3px 11px;
    background-size: 14px;
}
ul.grid-list li.input-grid-box input.input.time {
    background: url(../img/icons/icon-time.png) no-repeat scroll 3px 10px;
    background-size: 16px;
}
ul.grid-list li.input-grid-box input.input.rooms {
    background: url(../img/icons/icon-rooms.png) no-repeat scroll 3px 7px;
    background-size: 20px;
}


每次我构建项目并查看dist/assets/img时,只有一个图标(icon-rooms)具有哈希(icon-rooms.575a049f.png),而其他所有图标都位于/ icons /文件夹中而没有这样的哈希。为什么是这样?

最佳答案

默认情况下,生成的静态资产的文件名中包含哈希,以实现更好的缓存控制。

See official vue.js documentation

您可以禁用它。

关于javascript - Vue-为什么有些图像在生产中变得哈希,而另一些却没有?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/60916093/

10-11 05:46
查看更多