Skip to content

Commit b069788

Browse files
committed
feat: v1.12.0
1 parent 9f5a20e commit b069788

19 files changed

+170
-69
lines changed

docs/.vuepress/config.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,15 @@ export default defineConfig4CustomTheme<VdoingThemeConfig>({
130130
// archive: false, // 是否打开归档功能,默认true
131131
// categoryText: '随笔', // 碎片化文章(_posts文件夹的文章)预设生成的分类值,默认'随笔'
132132

133+
// pageStyle: 'line', // 页面风格,可选值:'card'卡片 | 'line' 线(未设置bodyBgImg时才生效), 默认'card'。 说明:card时背景显示灰色衬托出卡片样式,line时背景显示纯色,并且部分模块带线条边框
134+
133135
// bodyBgImg: [
134136
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175828.jpeg',
135137
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175845.jpeg',
136138
// 'https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200507175846.jpeg'
137-
// ], // body背景大图,默认无。 单张图片 String | 多张图片 Array, 多张图片时每隔15秒换一张。
138-
// bodyBgImgOpacity: 0.5, // body背景图透明度,选值 0.1~ 1.0, 默认0.5
139+
// ], // body背景大图,默认无。 单张图片 String | 多张图片 Array, 多张图片时隔bodyBgImgInterval切换一张。
140+
// bodyBgImgOpacity: 0.5, // body背景图透明度,选值 0.1~1.0, 默认0.5
141+
// bodyBgImgInterval: 15, // body多张背景图时的切换间隔, 默认15,单位s
139142
// titleBadge: false, // 文章标题前的图标是否显示,默认true
140143
// titleBadgeIcons: [ // 文章标题前图标的地址,默认主题内置图标
141144
// '图标地址1',

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"vuepress-plugin-one-click-copy": "^1.0.2",
2525
"vuepress-plugin-thirdparty-search": "^1.0.2",
2626
"vuepress-plugin-zooming": "^1.1.7",
27-
"vuepress-theme-vdoing": "^1.11.3",
27+
"vuepress-theme-vdoing": "^1.12.0",
2828
"yamljs": "^0.3.0"
2929
}
3030
}

vdoing/components/ArchivesPage.vue

+5
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ export default {
123123
<style lang='stylus'>
124124
@require '../styles/wrapper.styl'
125125
126+
.theme-style-line
127+
.archives-page .theme-vdoing-wrapper
128+
box-shadow 0 0
129+
// border 1px solid var(--borderColor)
130+
// border-radius 5px
126131
.archives-page
127132
.theme-vdoing-wrapper
128133
@extend $vdoing-wrapper

vdoing/components/ArticleInfo.vue

+4
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ export default {
140140
<style lang='stylus' scoped>
141141
@require '../styles/wrapper.styl'
142142
143+
.theme-style-line
144+
.articleInfo-wrap
145+
.articleInfo
146+
padding-top 0.5rem
143147
.articleInfo-wrap
144148
@extend $wrapper
145149
position relative

vdoing/components/BodyBgImg.vue

+9-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
<script>
99
import { type } from '../util'
1010
export default {
11-
data () {
11+
data() {
1212
return {
1313
bgImg: '',
1414
opacity: 0.5
1515
}
1616
},
17-
mounted () {
18-
let { bodyBgImg, bodyBgImgOpacity,bodyBgImgInterval = 15 } = this.$themeConfig
17+
mounted() {
18+
let { bodyBgImg, bodyBgImgOpacity, bodyBgImgInterval = 15 } = this.$themeConfig
1919
2020
if (type(bodyBgImg) === 'string') {
2121
this.bgImg = bodyBgImg
@@ -30,6 +30,12 @@ export default {
3030
count = 0
3131
}
3232
this.bgImg = bodyBgImg[count]
33+
34+
// 预加载下一张图片
35+
if (bodyBgImg[count + 1]) {
36+
const img = new Image()
37+
img.src = bodyBgImg[count + 1]
38+
}
3339
}, bodyBgImgInterval * 1000);
3440
}
3541

vdoing/components/CategoriesPage.vue

+13-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import Pagination from '@theme/components/Pagination'
3838
import CategoriesBar from '@theme/components/CategoriesBar'
3939
4040
export default {
41-
data () {
41+
data() {
4242
return {
4343
category: '',
4444
total: 0, // 总长
@@ -47,7 +47,7 @@ export default {
4747
}
4848
},
4949
components: { MainLayout, PostList, Pagination, CategoriesBar },
50-
mounted () {
50+
mounted() {
5151
const queryCategory = this.$route.query.category
5252
if (queryCategory) {
5353
this.category = queryCategory
@@ -70,12 +70,12 @@ export default {
7070
}
7171
},
7272
methods: {
73-
handlePagination (i) { // 分页
73+
handlePagination(i) { // 分页
7474
this.currentPage = i
7575
}
7676
},
7777
watch: {
78-
'$route.query.category' (category) {
78+
'$route.query.category'(category) {
7979
this.category = category ? decodeURIComponent(category) : ''
8080
if (this.category) {
8181
this.total = this.$groupPosts.categories[this.category].length
@@ -128,4 +128,13 @@ export default {
128128
display block
129129
.categories
130130
max-height 12.3rem
131+
.theme-style-line
132+
.categories-page
133+
.main-left
134+
.categories-wrapper
135+
@media (max-width $MQMobile)
136+
margin-top -0.91rem
137+
margin-bottom -1px
138+
padding 0.9rem 0.2rem
139+
padding-bottom 0.5rem
131140
</style>

vdoing/components/Home.vue

+7-2
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,13 @@ export default {
469469
margin-top 2rem
470470
.main-left
471471
.card-box
472-
margin-bottom 0.9rem
472+
margin-bottom 2rem
473473
.pagination
474-
margin-bottom 4rem
474+
margin-bottom 3rem
475475
.theme-vdoing-content
476476
padding 0 2rem
477477
overflow hidden
478+
border none
478479
&>:first-child
479480
padding-top 2rem
480481
&>:last-child
@@ -534,4 +535,8 @@ export default {
534535
.feature
535536
h2
536537
font-size 1.25rem
538+
.theme-style-line
539+
.main-wrapper
540+
@media (max-width 719px)
541+
margin-top -1px
537542
</style>

vdoing/components/MainLayout.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
@media (max-width 900px)
3333
width 235px
3434
.card-box
35-
margin 0 0 0.9rem 0.9rem
35+
margin 0 0 0.8rem 0.8rem
3636
padding-top 0.95rem
3737
padding-bottom 0.95rem
3838
// 719px以下
@@ -56,4 +56,9 @@
5656
margin 0 0 0.9rem 0
5757
border-radius 0
5858
width 100%
59+
.theme-style-line
60+
.main-wrapper
61+
.main-right
62+
.card-box
63+
margin -1px 0 0 0
5964
</style>

vdoing/components/Page.vue

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<main class="page">
44
<div :class="`theme-vdoing-wrapper ${bgStyle}`">
55
<ArticleInfo v-if="isArticle()" />
6+
<div v-else class="placeholder" />
67
<component
78
class="theme-vdoing-content"
89
v-if="pageComponent"
@@ -124,6 +125,16 @@ export default {
124125
padding-top: ($navbarHeight + 1.5rem)
125126
>*
126127
@extend $vdoing-wrapper
128+
.theme-style-line
129+
.page
130+
@media (min-width $MQMobile)
131+
padding-top $navbarHeight
132+
&>*
133+
&:not(.footer)
134+
box-shadow 0 0
135+
.placeholder
136+
@media (min-width 720px)
137+
height 1.2rem
127138
.theme-vdoing-wrapper
128139
.content-wrapper
129140
position relative

vdoing/components/Pagination.vue

+42-35
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,32 @@
22
<div class="pagination">
33
<span
44
class="card-box prev iconfont icon-jiantou-zuo"
5-
:class="{disabled: currentPage === 1}"
5+
:class="{ disabled: currentPage === 1 }"
66
@click="goPrex()"
77
>
88
<p>上一页</p>
99
</span>
1010

1111
<!-- 分页在5页及以下时 -->
12-
<div
13-
class="pagination-list"
14-
v-if="pages <= 5"
15-
>
12+
<div class="pagination-list" v-if="pages <= 5">
1613
<span
1714
class="card-box"
1815
v-for="item in pages"
1916
:key="item"
20-
:class="{active: currentPage === item}"
17+
:class="{ active: currentPage === item }"
2118
@click="goIndex(item)"
22-
>{{item}}</span>
19+
>{{ item }}</span
20+
>
2321
</div>
2422
<!-- 分页在5页以上 -->
25-
<div
26-
class="pagination-list"
27-
v-else
28-
>
23+
<div class="pagination-list" v-else>
2924
<!-- 一号位 -->
3025
<span
3126
class="card-box"
32-
:class="{active: currentPage === 1}"
27+
:class="{ active: currentPage === 1 }"
3328
@click="goIndex(1)"
34-
>1</span>
29+
>1</span
30+
>
3531

3632
<!-- 二号位 -->
3733
<span
@@ -44,42 +40,46 @@
4440
<span
4541
class="card-box"
4642
v-show="currentPage <= 3"
47-
:class="{active: currentPage === 2}"
43+
:class="{ active: currentPage === 2 }"
4844
@click="goIndex(2)"
49-
>2</span>
45+
>2</span
46+
>
5047

5148
<!-- 三号位 -->
5249
<span
5350
class="card-box"
54-
:class="{active: currentPage >= 3 && currentPage <= (pages - 2)}"
51+
:class="{ active: currentPage >= 3 && currentPage <= pages - 2 }"
5552
@click="goIndex(threeNum())"
56-
>{{ threeNum() }}</span>
53+
>{{ threeNum() }}</span
54+
>
5755

5856
<!-- 四号位 -->
5957
<span
6058
class="ellipsis ell-four"
61-
v-show="currentPage < (pages - 2)"
59+
v-show="currentPage < pages - 2"
6260
@click="goIndex(currentPage + 2)"
6361
title="下两页"
6462
/>
6563
<span
6664
class="card-box"
67-
v-show="currentPage >= (pages - 2)"
68-
:class="{active: currentPage === pages-1}"
69-
@click="goIndex(pages-1)"
70-
>{{ pages-1 }}</span>
65+
v-show="currentPage >= pages - 2"
66+
:class="{ active: currentPage === pages - 1 }"
67+
@click="goIndex(pages - 1)"
68+
>{{ pages - 1 }}</span
69+
>
7170

7271
<!-- 五号位 -->
7372
<span
7473
class="card-box"
75-
:class="{active: currentPage === pages}"
74+
:class="{ active: currentPage === pages }"
7675
@click="goIndex(pages)"
77-
>{{pages}}</span>
76+
>{{ pages }}</span
77+
>
7878
</div>
7979

8080
<span
8181
class="card-box next iconfont icon-jiantou-you"
82-
:class="{disabled: currentPage === pages}"
82+
:class="{ disabled: currentPage === pages }"
8383
@click="goNext()"
8484
>
8585
<p>下一页</p>
@@ -104,12 +104,12 @@ export default {
104104
}
105105
},
106106
computed: {
107-
pages () { // 总页数
107+
pages() { // 总页数
108108
return Math.ceil(this.total / this.perPage)
109109
}
110110
},
111111
methods: {
112-
threeNum () { // 三号位页码计算
112+
threeNum() { // 三号位页码计算
113113
let num = 3
114114
const currentPage = this.currentPage
115115
const pages = this.pages
@@ -122,24 +122,24 @@ export default {
122122
}
123123
return num
124124
},
125-
goPrex () {
125+
goPrex() {
126126
let currentPage = this.currentPage
127127
if (currentPage > 1) {
128128
this.handleEmit(--currentPage)
129129
}
130130
},
131-
goNext () {
131+
goNext() {
132132
let currentPage = this.currentPage
133133
if (currentPage < this.pages) {
134134
this.handleEmit(++currentPage)
135135
}
136136
},
137-
goIndex (i) {
137+
goIndex(i) {
138138
if (i !== this.currentPage) {
139139
this.handleEmit(i)
140140
}
141141
},
142-
handleEmit (i) {
142+
handleEmit(i) {
143143
this.$emit('getCurrentPage', i)
144144
}
145145
}
@@ -151,6 +151,9 @@ export default {
151151
position relative
152152
height 60px
153153
text-align center
154+
@media (max-width 720px)
155+
margin-left 1px
156+
margin-right 1px
154157
span
155158
line-height 1rem
156159
opacity 0.9
@@ -176,16 +179,20 @@ export default {
176179
top 0
177180
padding 1rem 1.2rem
178181
font-size 0.95rem
182+
&::before
183+
font-size 0.4rem
179184
&.disabled
180185
color rgba(125, 125, 125, 0.5)
181186
&.prev
182187
left 0
183-
border-top-right-radius 32px
184-
border-bottom-right-radius 32px
188+
// border-top-right-radius 32px
189+
// border-bottom-right-radius 32px
190+
&::before
191+
margin-right 0.3rem
185192
&.next
186193
right 0
187-
border-top-left-radius 32px
188-
border-bottom-left-radius 32px
194+
// border-top-left-radius 32px
195+
// border-bottom-left-radius 32px
189196
&::before
190197
float right
191198
margin-left 0.3rem

0 commit comments

Comments
 (0)