forked from AkkomaGang/admin-fe
fix[Screenfull]: fix screenfull bug (#1603)
This commit is contained in:
parent
9ed5db044f
commit
8c18c000d4
1 changed files with 11 additions and 3 deletions
|
@ -14,6 +14,9 @@ export default {
|
||||||
isFullscreen: false
|
isFullscreen: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
click() {
|
click() {
|
||||||
if (!screenfull.enabled) {
|
if (!screenfull.enabled) {
|
||||||
|
@ -23,9 +26,14 @@ export default {
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
screenfull.toggle().then(() => {
|
screenfull.toggle()
|
||||||
this.isFullscreen = screenfull.isFullscreen
|
},
|
||||||
})
|
init() {
|
||||||
|
if (screenfull.enabled) {
|
||||||
|
screenfull.on('change', () => {
|
||||||
|
this.isFullscreen = screenfull.isFullscreen
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue