opt: 缩略图生成算法

This commit is contained in:
RockYang
2023-11-28 14:50:19 +08:00
parent a7265c4251
commit 7e50e17aaf
6 changed files with 18 additions and 9 deletions

View File

@@ -45,9 +45,9 @@ onMounted(() => {
})
const computeSize = () => {
const w = container.value.offsetWidth - 8 // 减去滚动条的宽度
const w = container.value.offsetWidth - 10 // 减去滚动条的宽度
let cols = Math.floor(w / props.width)
itemWidth.value = Math.ceil(w / cols)
itemWidth.value = Math.floor(w / cols)
}
window.onresize = () => {