@jx3box/jx3box-common-ui 8.1.4 → 8.1.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "8.1.4",
3
+ "version": "8.1.6",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/cms.js CHANGED
@@ -58,4 +58,4 @@ function getTopicBucket(params) {
58
58
  return $cms().get(`/api/cms/topic/bucket`, { params });
59
59
  }
60
60
 
61
- export { getPostAuthors, uploadImage, upload, getDecoration, getDecorationJson, checkTeamMember, getHonorJson, getSliders, getCollection, getTopicBucket, };
61
+ export { getPostAuthors, uploadImage, upload, getDecoration, getDecorationJson, checkTeamMember, getHonorJson, getSliders, getCollection, getTopicBucket };
package/src/App.vue CHANGED
@@ -58,6 +58,8 @@
58
58
  <QRcode />
59
59
  <Sharing />
60
60
 
61
+ <PostGuide :post="post" />
62
+
61
63
  <hr />
62
64
 
63
65
  <markBy />
@@ -160,6 +162,7 @@ import PostCollection from "./single/PostCollection.vue";
160
162
  import Thx from "./single/Thx.vue";
161
163
  import Collection from "./single/Collection.vue";
162
164
  import Creators from "./single/Creators.vue";
165
+ import PostGuide from "./single/PostGuide.vue";
163
166
 
164
167
  import Mark from "./interact/Mark.vue";
165
168
  import Fav from "./interact/Fav.vue";
@@ -241,6 +244,7 @@ export default {
241
244
  WikiComments,
242
245
 
243
246
  UserPop,
247
+ PostGuide,
244
248
  },
245
249
  data: function () {
246
250
  return {
@@ -0,0 +1,44 @@
1
+ <template>
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 }">
4
+ <i class="el-icon-arrow-left"></i>
5
+ <span>上一篇: {{ getPostTitle(post.prev_post) }}</span>
6
+ </a>
7
+ <a :href="getPostLink(post.next_post)" class="el-button el-button--default el-button--small" :class="{'is-disabled': !post.next_post }">
8
+ <span>下一篇: {{ getPostTitle(post.next_post) }}</span>
9
+ <i class="el-icon-arrow-right"></i>
10
+ </a>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ props: {
17
+ post: {
18
+ type: Object,
19
+ default: () => {},
20
+ },
21
+ },
22
+ computed: {
23
+ hasGuide() {
24
+ return this.post.prev_post || this.post.next_post;
25
+ }
26
+ },
27
+ methods: {
28
+ getPostLink({ ID: id }) {
29
+ return id ? location.origin + "/post/" + id : "javascript:;";
30
+ },
31
+ getPostTitle(item) {
32
+ return item?.post_title || "";
33
+ }
34
+ },
35
+ };
36
+ </script>
37
+
38
+ <style lang="less">
39
+ .m-post-guide {
40
+ .flex;
41
+ align-items: center;
42
+ justify-content: space-between;
43
+ }
44
+ </style>