@jx3box/jx3box-vue3-ui 0.2.6 → 0.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-vue3-ui",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "JX3BOX Vue3 UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -13,6 +13,7 @@
13
13
  <!-- 面包屑内容 -->
14
14
  <Crumb :name="slug" v-if="crumbEnable" />
15
15
  <slot></slot>
16
+ <slot v-if="show" name="title"></slot>
16
17
  <div class="u-op">
17
18
  <slot name="op-append"></slot>
18
19
  <a
@@ -71,6 +72,7 @@ export default {
71
72
  isNotAdmin: !User.isEditor(),
72
73
  isOverlay: false,
73
74
  isApp: isApp(),
75
+ show: false,
74
76
  };
75
77
  },
76
78
  computed: {
@@ -85,8 +87,24 @@ export default {
85
87
  },
86
88
  publishLink,
87
89
  getAppIcon,
90
+ onShowTitle() {
91
+ // 小屏不显示
92
+ if (window.innerWidth < 1680) {
93
+ return;
94
+ }
95
+ let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
96
+ if (scrollTop > 100) {
97
+ this.show = true;
98
+ } else {
99
+ this.show = false;
100
+ }
101
+ }
102
+ },
103
+ beforeUnmount() {
104
+ document.removeEventListener("scroll", this.onShowTitle);
88
105
  },
89
106
  mounted: function () {
107
+ document.addEventListener("scroll", this.onShowTitle);
90
108
  Bus.on("toggleLeftSide", (data) => {
91
109
  this.isOpen = data;
92
110
  });
@@ -63,7 +63,8 @@ export default {
63
63
  // if(location.pathname.startsWith('/index') || location.pathname.startsWith('/origin')){
64
64
  // location.href = 'https://' + item.to
65
65
  // }else{
66
- location.href = location.href.replace(item.from, item.to);
66
+ const href = location.href.replace(location.host, item.to);
67
+ location.href = href;
67
68
  // }
68
69
  },
69
70
  },