fix: 修复隐藏标签页问题 (#69)

* fix: 修复隐藏标签页问题
This commit is contained in:
一万
2021-10-23 22:50:03 +08:00
committed by GitHub
parent 7dcf98a178
commit 70af35dbf5
3 changed files with 25 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import { split } from "lodash-es";
import { nextTick } from "vue";
import panel from "../panel/index.vue";
import { useRouter } from "vue-router";
import { emitter } from "/@/utils/mitt";
@@ -47,6 +48,16 @@ settings.weekVal === null
? localOperate("weekVal", false, "set")
: document.querySelector("html")?.setAttribute("class", "html-weakness");
if (settings.tagsVal === null) {
localOperate("tagsVal", false, "set");
settings.tagsVal = false;
}
nextTick(() => {
window.document
.querySelector(".app-main")
?.setAttribute("data-show-tag", settings.tagsVal);
});
function toggleClass(flag: boolean, clsName: string, target?: HTMLElement) {
const targetEl = target || document.body;
let { className } = targetEl;

View File

@@ -447,6 +447,9 @@ onBeforeMount(() => {
emitter.on("tagViewsChange", key => {
if (unref(showTags) === key) return;
showTags.value = key;
window.document
.querySelector(".app-main")
?.setAttribute("data-show-tag", key);
});
// 改变标签风格