@jx3box/jx3box-common-ui 8.1.6 → 8.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/single/PostGuide.vue +25 -4
package/package.json
CHANGED
package/src/single/PostGuide.vue
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="m-post-guide" v-if="hasGuide">
|
|
3
|
-
<a :href="getPostLink(post.prev_post)" class="el-button el-button--default el-button--small" :class="{'is-disabled': !post.prev_post }">
|
|
3
|
+
<a :href="getPostLink(post.prev_post)" class="el-button el-button--default el-button--small u-prev" :class="{'is-disabled': !post.prev_post }">
|
|
4
4
|
<i class="el-icon-arrow-left"></i>
|
|
5
5
|
<span>上一篇: {{ getPostTitle(post.prev_post) }}</span>
|
|
6
6
|
</a>
|
|
7
|
-
<a :href="getPostLink(post.next_post)" class="el-button el-button--default el-button--small" :class="{'is-disabled': !post.next_post }">
|
|
7
|
+
<a :href="getPostLink(post.next_post)" class="el-button el-button--default el-button--small u-next" :class="{'is-disabled': !post.next_post }">
|
|
8
8
|
<span>下一篇: {{ getPostTitle(post.next_post) }}</span>
|
|
9
9
|
<i class="el-icon-arrow-right"></i>
|
|
10
10
|
</a>
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script>
|
|
15
|
+
import { getLink } from '@jx3box/jx3box-common/js/utils';
|
|
15
16
|
export default {
|
|
16
17
|
props: {
|
|
17
18
|
post: {
|
|
@@ -25,8 +26,9 @@ export default {
|
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
methods: {
|
|
28
|
-
getPostLink({ ID: id }) {
|
|
29
|
-
|
|
29
|
+
getPostLink({ ID: id, post_type }) {
|
|
30
|
+
const link = id ? getLink(post_type, id) : "javascript:;";
|
|
31
|
+
return link;
|
|
30
32
|
},
|
|
31
33
|
getPostTitle(item) {
|
|
32
34
|
return item?.post_title || "";
|
|
@@ -41,4 +43,23 @@ export default {
|
|
|
41
43
|
align-items: center;
|
|
42
44
|
justify-content: space-between;
|
|
43
45
|
}
|
|
46
|
+
|
|
47
|
+
@media screen and (max-width: @phone) {
|
|
48
|
+
.m-post-guide {
|
|
49
|
+
flex-wrap: wrap;
|
|
50
|
+
|
|
51
|
+
.u-prev,.u-next {
|
|
52
|
+
width: 100%;
|
|
53
|
+
.nobreak;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.u-prev {
|
|
57
|
+
margin-bottom: 10px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.u-next {
|
|
61
|
+
margin-left: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
44
65
|
</style>
|