ios倍图
// less倍图 /* ios倍图切换 */ .bg-image(@url) { background-image: ~"url('~@/assets/images/2x/@{url}@2x.png')"; @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) { background-image: ~"url('~@/assets/images/3x/@{url}@3x.png')"; } background-size: 100% 100%; }
android倍图
参考地址:ldpi mdpi hdpi xhdpi xxhdpi xxxhdpi
/* android倍图切换 */ .bg-image(@url) { background-image: ~"url('~@/assets/images/xhdpi/@{url}.png')"; @media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) { background-image: ~"url('~@/assets/images/xxhdpi/@{url}.png')"; } background-size: 100% 100%; }