隐藏模态框事件绑定
This commit is contained in:
parent
78039c46d5
commit
0917a4c8ed
@ -169,15 +169,7 @@ new Vue({
|
|||||||
document.addEventListener('copy', () => {
|
document.addEventListener('copy', () => {
|
||||||
this.showMessage('你都复制了些什么呀,转载要记得加上出处哦')
|
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 hideModal = (function() {
|
||||||
let modals = document.querySelectorAll('.page-modal')
|
let modals = document.querySelectorAll('.page-modal')
|
||||||
Array.prototype.forEach.call(modals, modal => {
|
Array.prototype.forEach.call(modals, modal => {
|
||||||
@ -189,6 +181,13 @@ new Vue({
|
|||||||
Array.prototype.forEach.call(document.querySelectorAll('.js-modal-close'), modalClose => {
|
Array.prototype.forEach.call(document.querySelectorAll('.js-modal-close'), modalClose => {
|
||||||
modalClose.addEventListener('click', hideModal)
|
modalClose.addEventListener('click', hideModal)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// 夜间模式
|
||||||
|
let night = localStorage.getItem('night')
|
||||||
|
try {
|
||||||
|
if(night && eval(night)) document.querySelector('body').classList.add('night')
|
||||||
|
} catch (e){}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user