opt: 优化 ItemList 组件样式

This commit is contained in:
RockYang
2023-11-11 10:53:33 +08:00
parent 5f921965e6
commit 427b434ce3
6 changed files with 26 additions and 27 deletions

View File

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