Open NickZhangjin opened 9 months ago
+1
+1 @qmhc @kingyue737 grid-layout.vue 文件内如下修改:
onWindowResize 方法 添加 if (props.responsive) { responsiveGridLayout() // 确保布局在调整窗口大小时更新 } ` function onWindowResize() {
if (wrapper.value) { console.log(wrapper.value) state.width = wrapper.value.offsetWidth }
++ if (props.responsive) { ++ responsiveGridLayout() // 确保布局在调整窗口大小时更新 ++ }
emitter.emit('resizeEvent')
} `
responsiveGridLayout 方法 最后添加 currentLayout.value = layout ` function responsiveGridLayout() { const newBreakpoint = getBreakpointFromWidth(props.breakpoints, state.width) // ......其余保持不变 emitter.emit('setColNum', getColsFromBreakpoint(newBreakpoint, props.cols))
++// 添加这行代码以确保布局在调整窗口大小时更新,解决堆叠问题 ++ currentLayout.value = layout } `
经过测试, 堆叠问题消失,因权限问题,希望作者更新一下
设置Responsive时会出现堆叠的问题