This commit is contained in:
‘937886381’
2024-07-05 16:33:14 +08:00
parent 44f3ab3e99
commit 865698a9be
5 changed files with 141 additions and 80 deletions

View File

@@ -2,7 +2,7 @@
<div :class="classObj" class="app-wrapper" :style="{ '--current-color': theme }">
<div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
<sidebar v-if="!sidebar.hide" class="sidebar-container" />
<div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container">
<div ref="mainContainer" :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container">
<div :class="{ 'fixed-header': fixedHeader }">
<navbar />
<tags-view v-if="needTagsView" />
@@ -59,19 +59,14 @@ export default {
}
},
watch: {
// changeColor(val) {
// if (val == true) {
// var tag = document.getElementsByClassName("main-container")
// console.log('tag', tag);
// tag.style.backgroundColor = 'rgba(0, 21, 41, 1)'
// } else {
// var tag = document.getElementsByClassName("main-container")
// // for (let i in tag) {
// tag.style.backgroundColor = ''
// // tag[i].classList.add("default")
// // }
// }
// },
changeColor(val) {
if (val == true) {
console.log('this.$refs.mainContainer', this.$refs.mainContainer);
this.$refs.mainContainer.style.backgroundColor = 'rgba(0, 21, 41, 1)'
} else {
this.$refs.mainContainer.style.backgroundColor = ''
}
},
},
methods: {
handleClickOutside() {