refactor(projects): 文件夹位置规范

This commit is contained in:
Soybean
2021-11-23 10:52:30 +08:00
parent 3fb7a5f709
commit f5a5f44a2b
26 changed files with 60 additions and 192 deletions

View File

@ -1,36 +0,0 @@
import { watch } from 'vue';
import { useThemeStore } from '@/store';
export default function setupWindicssDarkMode() {
const theme = useThemeStore();
const DARK_CLASS = 'dark';
function getHtmlElement() {
return document.querySelector('html');
}
function addDarkClass() {
const html = getHtmlElement();
if (html) {
html.classList.add(DARK_CLASS);
}
}
function removeDarkClass() {
const html = getHtmlElement();
if (html) {
html.classList.remove(DARK_CLASS);
}
}
watch(
() => theme.darkMode,
newValue => {
if (newValue) {
addDarkClass();
} else {
removeDarkClass();
}
},
{ immediate: true }
);
}

View File

@ -1,4 +1,3 @@
import setupAssets from './assets';
import setupWindicssDarkMode from './dark-mode';
export { setupAssets, setupWindicssDarkMode };
export { setupAssets };