From a1d6ad34530854699c38f3d5127c21b293083b93 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 13 Feb 2019 16:10:23 +0800 Subject: [PATCH 1/2] fix[Screenfull]: fix screenfull click bug --- src/components/Screenfull/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue index 5801ba4a..7f8e6fc3 100644 --- a/src/components/Screenfull/index.vue +++ b/src/components/Screenfull/index.vue @@ -1,6 +1,6 @@ From 0fed69f367899c6f5d3321e5cb86b84faa08d2e9 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 13 Feb 2019 16:34:03 +0800 Subject: [PATCH 2/2] perf[Screenfull]: refactor screenfull component --- package.json | 2 +- src/components/Screenfull/index.vue | 6 ++++-- src/icons/svg/exit-fullscreen.svg | 1 + src/icons/svg/{screenfull.svg => fullscreen.svg} | 0 src/lang/en.js | 1 - src/lang/es.js | 1 - src/lang/zh.js | 1 - src/views/layout/components/Navbar.vue | 4 +--- 8 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 src/icons/svg/exit-fullscreen.svg rename src/icons/svg/{screenfull.svg => fullscreen.svg} (100%) diff --git a/package.json b/package.json index 5854b8d6..77c25de4 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "mockjs": "1.0.1-beta3", "normalize.css": "7.0.0", "nprogress": "0.2.0", - "screenfull": "3.3.3", + "screenfull": "4.0.0", "showdown": "1.8.6", "sortablejs": "1.7.0", "tui-editor": "1.2.7", diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue index 7f8e6fc3..8e7bcba4 100644 --- a/src/components/Screenfull/index.vue +++ b/src/components/Screenfull/index.vue @@ -1,6 +1,6 @@ @@ -23,7 +23,9 @@ export default { }) return false } - screenfull.toggle() + screenfull.toggle().then(() => { + this.isFullscreen = screenfull.isFullscreen + }) } } } diff --git a/src/icons/svg/exit-fullscreen.svg b/src/icons/svg/exit-fullscreen.svg new file mode 100644 index 00000000..485c128b --- /dev/null +++ b/src/icons/svg/exit-fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/screenfull.svg b/src/icons/svg/fullscreen.svg similarity index 100% rename from src/icons/svg/screenfull.svg rename to src/icons/svg/fullscreen.svg diff --git a/src/lang/en.js b/src/lang/en.js index ef98af4b..05b34598 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -69,7 +69,6 @@ export default { logOut: 'Log Out', dashboard: 'Dashboard', github: 'Github', - screenfull: 'Screenfull', theme: 'Theme', size: 'Global Size' }, diff --git a/src/lang/es.js b/src/lang/es.js index ed71fc15..8575d382 100755 --- a/src/lang/es.js +++ b/src/lang/es.js @@ -69,7 +69,6 @@ export default { logOut: 'Salir', dashboard: 'Panel de control', github: 'Github', - screenfull: 'Pantalla completa', theme: 'Tema', size: 'Tamaño global' }, diff --git a/src/lang/zh.js b/src/lang/zh.js index 7da0ccee..1fd18355 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -69,7 +69,6 @@ export default { logOut: '退出登录', dashboard: '首页', github: '项目地址', - screenfull: '全屏', theme: '换肤', size: '布局大小' }, diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue index dcb09ec1..5c3bcda4 100644 --- a/src/views/layout/components/Navbar.vue +++ b/src/views/layout/components/Navbar.vue @@ -10,9 +10,7 @@ - - - +