Skip to content

Commit 031885f

Browse files
author
cl199793
committed
fix image ssr
1 parent feaa2cc commit 031885f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/image/src/image-viewer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const Mode = {
6666
}
6767
};
6868
69-
const isFirefox = !!window.navigator.userAgent.match(/firefox/i);
69+
const isFirefox = typeof window !== 'undefined' && !!window.navigator.userAgent.match(/firefox/i);
7070
const mousewheelEventName = isFirefox ? 'DOMMouseScroll' : 'mousewheel';
7171
7272
export default {

0 commit comments

Comments
 (0)