feat: v1.12.3
This commit is contained in:
parent
a6ea991a29
commit
bc6cc128e2
|
|
@ -155,6 +155,9 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
|
||||||
// sidebarOpen: false, // 初始状态是否打开左侧边栏,默认true
|
// sidebarOpen: false, // 初始状态是否打开左侧边栏,默认true
|
||||||
// pageButton: false, // 是否显示快捷翻页按钮,默认true
|
// pageButton: false, // 是否显示快捷翻页按钮,默认true
|
||||||
|
|
||||||
|
// 默认外观模式(用户未在页面手动修改过模式时才生效,否则以用户设置的模式为准),可选:'auto' | 'light' | 'dark' | 'read',默认'auto'。
|
||||||
|
// defaultMode: 'auto',
|
||||||
|
|
||||||
// 侧边栏 'structuring' | { mode: 'structuring', collapsable: Boolean} | 'auto' | <自定义> 温馨提示:目录页数据依赖于结构化的侧边栏数据,如果你不设置为'structuring',将无法使用目录页
|
// 侧边栏 'structuring' | { mode: 'structuring', collapsable: Boolean} | 'auto' | <自定义> 温馨提示:目录页数据依赖于结构化的侧边栏数据,如果你不设置为'structuring',将无法使用目录页
|
||||||
sidebar: 'structuring',
|
sidebar: 'structuring',
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
"vuepress-plugin-one-click-copy": "^1.0.2",
|
"vuepress-plugin-one-click-copy": "^1.0.2",
|
||||||
"vuepress-plugin-thirdparty-search": "^1.0.2",
|
"vuepress-plugin-thirdparty-search": "^1.0.2",
|
||||||
"vuepress-plugin-zooming": "^1.1.7",
|
"vuepress-plugin-zooming": "^1.1.7",
|
||||||
"vuepress-theme-vdoing": "^1.12.1",
|
"vuepress-theme-vdoing": "^1.12.3",
|
||||||
"yamljs": "^0.3.0"
|
"yamljs": "^0.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ export default {
|
||||||
scrollTop: null,
|
scrollTop: null,
|
||||||
showCommentBut: false,
|
showCommentBut: false,
|
||||||
commentTop: null,
|
commentTop: null,
|
||||||
currentMode: null,
|
currentMode: '',
|
||||||
showModeBox: false,
|
showModeBox: false,
|
||||||
modeList: [
|
modeList: [
|
||||||
{
|
{
|
||||||
|
|
@ -89,8 +89,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.currentMode = storage.get('mode') || 'auto'
|
this.currentMode = storage.get('mode') || this.$themeConfig.defaultMode ||'auto'
|
||||||
|
|
||||||
this.scrollTop = this.getScrollTop()
|
this.scrollTop = this.getScrollTop()
|
||||||
window.addEventListener('scroll', debounce(() => {
|
window.addEventListener('scroll', debounce(() => {
|
||||||
this.scrollTop = this.getScrollTop()
|
this.scrollTop = this.getScrollTop()
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ export default {
|
||||||
hideNavbar: false,
|
hideNavbar: false,
|
||||||
isSidebarOpen: true,
|
isSidebarOpen: true,
|
||||||
showSidebar: false,
|
showSidebar: false,
|
||||||
themeMode: 'light',
|
themeMode: 'auto',
|
||||||
showWindowLB: true,
|
showWindowLB: true,
|
||||||
showWindowRB: true
|
showWindowRB: true
|
||||||
}
|
}
|
||||||
|
|
@ -203,7 +203,6 @@ export default {
|
||||||
'have-body-img': this.$themeConfig.bodyBgImg,
|
'have-body-img': this.$themeConfig.bodyBgImg,
|
||||||
'only-sidebarItem': this.sidebarItems.length === 1 && this.sidebarItems[0].type === 'page', // 左侧边栏只有一项时
|
'only-sidebarItem': this.sidebarItems.length === 1 && this.sidebarItems[0].type === 'page', // 左侧边栏只有一项时
|
||||||
},
|
},
|
||||||
// 'theme-mode-' + this.themeMode,
|
|
||||||
userPageClass
|
userPageClass
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -217,7 +216,11 @@ export default {
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
this.isSidebarOpenOfclientWidth()
|
this.isSidebarOpenOfclientWidth()
|
||||||
const mode = storage.get('mode') // 不放在created是因为vuepress不能在created访问浏览器api,如window
|
const mode = storage.get('mode') // 不放在created是因为vuepress不能在created访问浏览器api,如window
|
||||||
if (!mode || mode === 'auto') { // 当未切换过模式,或模式处于'跟随系统'时
|
const { defaultMode } = this.$themeConfig
|
||||||
|
|
||||||
|
if (defaultMode && defaultMode !== 'auto' && !mode ) {
|
||||||
|
this.themeMode = defaultMode
|
||||||
|
} else if(!mode || mode === 'auto' || defaultMode === 'auto') { // 当未切换过模式,或模式处于'跟随系统'时
|
||||||
this._autoMode()
|
this._autoMode()
|
||||||
} else {
|
} else {
|
||||||
this.themeMode = mode
|
this.themeMode = mode
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "vuepress-theme-vdoing",
|
"name": "vuepress-theme-vdoing",
|
||||||
"version": "1.12.1",
|
"version": "1.12.3",
|
||||||
"description": "Vdoing theme for VuePress. 一个基于VuePress的知识管理兼博客主题。",
|
"description": "Vdoing theme for VuePress. 一个基于VuePress的知识管理兼博客主题。",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "gaoyi(Evan) Xu"
|
"name": "gaoyi(Evan) Xu"
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,12 @@ export interface VdoingThemeConfig extends NoSidebar4DefaultThemeConfig {
|
||||||
*/
|
*/
|
||||||
pageButton?: boolean;
|
pageButton?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认外观模式
|
||||||
|
* @default 'auto'
|
||||||
|
*/
|
||||||
|
defaultMode?: 'auto' | 'light' | 'dark' | 'read';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 侧边栏配置
|
* 侧边栏配置
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue