fix[Screenfull]: fix screenfull bug (#1603)
This commit is contained in:
parent
a9fd6e2919
commit
e0991da9cf
|
@ -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…
Reference in New Issue