Skip to content

Commit

Permalink
Merge pull request #598 from jaw52/master
Browse files Browse the repository at this point in the history
feat(背景图): 增加切换时间设置
  • Loading branch information
xugaoyi authored May 31, 2022
2 parents 877ff2b + 053051e commit 9f5a20e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ node_modules
# yarn
yarn.lock

pnpm-lock.yaml

# vscode
.vscode

Expand Down
4 changes: 2 additions & 2 deletions vdoing/components/BodyBgImg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
}
},
mounted () {
let { bodyBgImg, bodyBgImgOpacity } = this.$themeConfig
let { bodyBgImg, bodyBgImgOpacity,bodyBgImgInterval = 15 } = this.$themeConfig
if (type(bodyBgImg) === 'string') {
this.bgImg = bodyBgImg
Expand All @@ -30,7 +30,7 @@ export default {
count = 0
}
this.bgImg = bodyBgImg[count]
}, 15000);
}, bodyBgImgInterval * 1000);
}
if (bodyBgImgOpacity !== undefined) {
Expand Down
7 changes: 7 additions & 0 deletions vdoing/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ export interface VdoingThemeConfig extends NoSidebar4DefaultThemeConfig {
*/
bodyBgImgOpacity?: 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1;


/**
* body当多张背景图时,设置切换时间,默认15s
* @default 15
*/
bodyBgImgInterval?: number;

/**
* 是否显示文章标题前的图标
* @default true
Expand Down

1 comment on commit 9f5a20e

@vercel
Copy link

@vercel vercel bot commented on 9f5a20e May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.