From 0917a4c8ed113f31b12b4dc6cb410ae3af062c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=93=E5=8F=91=E5=8F=97=E9=95=BF=E7=94=9F?= Date: Mon, 8 Jul 2019 15:15:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=A8=A1=E6=80=81=E6=A1=86?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/yilia/source-src/js/slider.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/themes/yilia/source-src/js/slider.js b/themes/yilia/source-src/js/slider.js index 7fac8ff..772eece 100644 --- a/themes/yilia/source-src/js/slider.js +++ b/themes/yilia/source-src/js/slider.js @@ -169,15 +169,7 @@ new Vue({ document.addEventListener('copy', () => { this.showMessage('你都复制了些什么呀,转载要记得加上出处哦') }) - }, - created() { - // 夜间模式 - let night = localStorage.getItem('night') - try { - if(night && eval(night)) document.querySelector('body').classList.add('night') - } catch (e){} - }, - mounted() { + // 隐藏模态框 let hideModal = (function() { let modals = document.querySelectorAll('.page-modal') Array.prototype.forEach.call(modals, modal => { @@ -189,6 +181,13 @@ new Vue({ Array.prototype.forEach.call(document.querySelectorAll('.js-modal-close'), modalClose => { modalClose.addEventListener('click', hideModal) }) + }, + created() { + // 夜间模式 + let night = localStorage.getItem('night') + try { + if(night && eval(night)) document.querySelector('body').classList.add('night') + } catch (e){} } })