This commit is contained in:
2025-12-24 11:10:54 +08:00
parent e514536d1b
commit 75c9ea0c3c
2 changed files with 17 additions and 7 deletions

View File

@@ -53,15 +53,25 @@ export function useColumnCount(onChange = () => {}) {
onMounted(() => {
columnCount.value = 2
calcColumn()
// if (process.client) {
window.addEventListener('resize', calcColumn)
// }
try {
// if (process.client) {
window.addEventListener('resize', calcColumn)
// }
} catch (error) {
}
})
onUnmounted(() => {
// if (process.client) {
window.removeEventListener('resize', calcColumn)
// }
try {
// if (process.client) {
window.removeEventListener('resize', calcColumn)
// }
} catch (error) {
}
})
// 列数变化时执行回调