Skip to content

Commit ffbfad1

Browse files
committed
Fix window not defined error
1 parent 334dac1 commit ffbfad1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-pure-lightbox",
3-
"version": "2.1.2",
3+
"version": "2.1.3",
44
"description": "Very lightweight, JavaScript-only, lightbox plugin for Vue.js",
55
"main": "dist-module/main.js",
66
"scripts": {

src/main.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ const Lightbox = {
1010
},
1111
}
1212

13-
if (typeof window !== 'undefined' && window.Vue) {
14-
window.Vue.use(Lightbox);
13+
if (typeof window !== 'undefined') {
14+
if (window.Vue) {
15+
window.Vue.use(Lightbox)
16+
}
17+
1518
window.Lightbox = Lightbox
1619
}
1720

0 commit comments

Comments
 (0)