mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-01-13 09:54:12 +00:00
更新代码和文档
This commit is contained in:
@@ -43,12 +43,16 @@ watch(darkMode, (newValue) => {
|
||||
emit('theme-change', newValue)
|
||||
|
||||
// 应用主题到body
|
||||
if (newValue) {
|
||||
document.body.classList.add('dark-theme')
|
||||
document.documentElement.classList.add('dark-theme')
|
||||
} else {
|
||||
document.body.classList.remove('dark-theme')
|
||||
document.documentElement.classList.remove('dark-theme')
|
||||
const html = document.documentElement;
|
||||
const body = document.body;
|
||||
if (html && body && html.classList && body.classList) {
|
||||
if (newValue) {
|
||||
body.classList.add('dark-theme')
|
||||
html.classList.add('dark-theme')
|
||||
} else {
|
||||
body.classList.remove('dark-theme')
|
||||
html.classList.remove('dark-theme')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -57,9 +61,11 @@ onMounted(() => {
|
||||
emit('theme-change', darkMode.value)
|
||||
|
||||
// 应用初始主题
|
||||
if (darkMode.value) {
|
||||
document.body.classList.add('dark-theme')
|
||||
document.documentElement.classList.add('dark-theme')
|
||||
const html = document.documentElement;
|
||||
const body = document.body;
|
||||
if (html && body && html.classList && body.classList && darkMode.value) {
|
||||
body.classList.add('dark-theme')
|
||||
html.classList.add('dark-theme')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -388,8 +388,14 @@ export default {
|
||||
return date.toLocaleString('zh-CN')
|
||||
},
|
||||
checkTheme() {
|
||||
this.isDarkTheme = document.body.classList.contains('dark-theme') ||
|
||||
document.documentElement.classList.contains('dark-theme')
|
||||
const html = document.documentElement;
|
||||
const body = document.body;
|
||||
if (html && body && html.classList && body.classList) {
|
||||
this.isDarkTheme = body.classList.contains('dark-theme') ||
|
||||
html.classList.contains('dark-theme')
|
||||
} else {
|
||||
this.isDarkTheme = false;
|
||||
}
|
||||
},
|
||||
renderContent(h, { node, data, store }) {
|
||||
const isFolder = data.fileType === 'folder'
|
||||
|
||||
@@ -94,6 +94,14 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
// 配置Monaco Editor使用国内CDN (npmmirror)
|
||||
// npmmirror的路径格式: https://registry.npmmirror.com/包名/版本号/files/文件路径
|
||||
loader.config({
|
||||
paths: {
|
||||
vs: 'https://registry.npmmirror.com/monaco-editor/0.55.1/files/min/vs'
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化Monaco Editor
|
||||
monaco = await loader.init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user