diff --git a/hook/useColumnCount.js b/hook/useColumnCount.js index 48421e1..8acd19f 100644 --- a/hook/useColumnCount.js +++ b/hook/useColumnCount.js @@ -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) { + + } + }) // 列数变化时执行回调 diff --git a/main.js b/main.js index 570d0bb..dcc7438 100644 --- a/main.js +++ b/main.js @@ -28,7 +28,7 @@ import MyIcons from '@/components/My-icons/my-icons.vue'; import GlobalPopup from '@/components/GlobalPopup/GlobalPopup.vue' // import Tabbar from '@/components/tabbar/midell-box.vue' // 自动导入 directives 目录下所有指令 -console.log(lightAppJssdk) + const directives = import.meta.glob('./directives/*.js', { eager: true });