You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by cr...@apache.org on 2024/12/19 07:27:31 UTC
(iotdb-docs) branch wx_fix_router created (now 7b0caceb)
This is an automated email from the ASF dual-hosted git repository.
critas pushed a change to branch wx_fix_router
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git
at 7b0caceb fix: Fix the issue where the page must be refreshed after the update
This branch includes the following new commits:
new 7b0caceb fix: Fix the issue where the page must be refreshed after the update
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(iotdb-docs) 01/01: fix: Fix the issue where the page must be refreshed after the update
Posted by cr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
critas pushed a commit to branch wx_fix_router
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git
commit 7b0caceb5e7e90863019cc8da84570bd259e3d60
Author: CritasWang <cr...@outlook.com>
AuthorDate: Thu Dec 19 15:27:16 2024 +0800
fix: Fix the issue where the page must be refreshed after the update
---
src/.vuepress/client.ts | 14 ++++++++++++++
src/.vuepress/styles/index.scss | 20 ++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/src/.vuepress/client.ts b/src/.vuepress/client.ts
index 7464fa71..2cac38ff 100644
--- a/src/.vuepress/client.ts
+++ b/src/.vuepress/client.ts
@@ -18,6 +18,7 @@
import { defineDocSearchConfig } from '@vuepress/plugin-docsearch/client';
import { computed } from 'vue';
+import { useRouter, withBase } from 'vuepress/client';
import { defineClientConfig, usePageData } from 'vuepress/client';
import DocSearch from './components/DocSearch.vue';
import { getDocVersion } from './utils/index.js';
@@ -28,6 +29,19 @@ export default defineClientConfig({
},
setup() {
const pageData = usePageData();
+ const router = useRouter();
+
+ let lastTo = '';
+
+ router.onError((error) => {
+ console.warn(error);
+ if(!lastTo) return;
+ window.location.href = withBase(lastTo);
+ lastTo = '';
+ });
+ router.beforeEach((to) => {
+ lastTo = to.fullPath;
+ });
const docSearchConfig = computed(() => ({
appId: 'JLT9R2YGAE',
diff --git a/src/.vuepress/styles/index.scss b/src/.vuepress/styles/index.scss
index 072e55dc..e36ad3a3 100644
--- a/src/.vuepress/styles/index.scss
+++ b/src/.vuepress/styles/index.scss
@@ -16,6 +16,12 @@
* limitations under the License.
*/
+// #main-description {
+// max-width: 55rem;
+// }
+.vp-skip-link {
+ z-index: 1;
+}
.vp-hero-image {
max-width: 420px;
}
@@ -82,3 +88,17 @@ footer {
div[class*='language-'] pre code {
color: var(--code-c-text);
}
+
+.home {
+ .theme-hope-content {
+ inset: 0;
+ z-index: 0;
+ position: relative;
+ background-attachment: fixed;
+ background-position: 50%;
+ background-size: cover;
+ max-width: 100%;
+ padding: 0;
+ display: inline;
+ }
+}
\ No newline at end of file