diff --git a/package.json b/package.json index a5c26e44..015d8b19 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "axios": "0.18.0", "clipboard": "1.7.1", "codemirror": "5.39.2", - "connect": "3.6.6", "driver.js": "0.8.1", "dropzone": "5.2.0", "echarts": "4.1.0", @@ -79,6 +78,7 @@ "babel-preset-stage-2": "6.24.1", "chalk": "2.4.1", "compression-webpack-plugin": "2.0.0", + "connect": "3.6.6", "copy-webpack-plugin": "4.5.2", "cross-env": "5.2.0", "css-loader": "1.0.0", diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue index 8e7bcba4..479bf3e3 100644 --- a/src/components/Screenfull/index.vue +++ b/src/components/Screenfull/index.vue @@ -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 + }) + } } } }