Skip to content

Commit

Permalink
fix: 服务端编译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
tomiaa12 committed Aug 7, 2023
1 parent 6e820ef commit c4f76be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/src/isMobile.ts
Expand Up @@ -7,5 +7,7 @@ const onResize = () => {
isMobile.value = document.documentElement.clientWidth < 768
console.log(isMobile.value)
}
window.addEventListener("resize", onResize)
inBrowser && onResize()
if (inBrowser) {
window.addEventListener("resize", onResize)
onResize()
}

0 comments on commit c4f76be

Please sign in to comment.