fix[Screenfull]: fix screenfull bug (#1603)

pull/1605/head
花裤衩 6 years ago committed by GitHub
parent 9ed5db044f
commit 8c18c000d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,6 +14,9 @@ export default {
isFullscreen: false
}
},
mounted() {
this.init()
},
methods: {
click() {
if (!screenfull.enabled) {
@ -23,9 +26,14 @@ export default {
})
return false
}
screenfull.toggle().then(() => {
this.isFullscreen = screenfull.isFullscreen
})
screenfull.toggle()
},
init() {
if (screenfull.enabled) {
screenfull.on('change', () => {
this.isFullscreen = screenfull.isFullscreen
})
}
}
}
}

Loading…
Cancel
Save