diff --git a/src/.vuepress/components/Sidevar.vue b/src/.vuepress/components/Sidevar.vue
index 6293387de..c2f25e087 100644
--- a/src/.vuepress/components/Sidevar.vue
+++ b/src/.vuepress/components/Sidevar.vue
@@ -2,19 +2,24 @@
@@ -24,10 +29,11 @@
import { useSidebarItems } from "vuepress-theme-hope/modules/sidebar/composables/index.js";
import Sidebar from 'vuepress-theme-hope/modules/sidebar/components/Sidebar.js';
import { ref, watch, computed } from 'vue';
-import { useRoute } from 'vuepress/client';
-import { getDialect, getDocVersion } from '../utils/index.js';
+import { useRoute, withBase, useRouter } from 'vuepress/client';
+import { getDialect, getDocVersion, URL_SUFFIX } from '../utils/index.js';
const route = useRoute();
+const router = useRouter();
const currentLang = ref('zh');
const currentVersion = ref('');
const currentDialect = ref('');
@@ -36,9 +42,11 @@ const ModelName = computed(() => {
return currentLang.value === 'zh' ? {
'Tree': '树模型',
'Table': '表模型',
+ 'Tip': '模型选择说明',
} : {
'Tree': 'Tree',
'Table': 'Table',
+ 'Tip': 'Model Choice Description',
};
});
@@ -47,14 +55,17 @@ const sidebarItems = useSidebarItems();
function handleChangeDialect(val: string) {
const oldPath = 'latest';
const newPath = 'latest-Table';
- if(currentDialect.value ==='Table'){
+ if (currentDialect.value === 'Table') {
window.location.href = window.location.href.replace(newPath, oldPath);
} else {
window.location.href = window.location.href.replace(oldPath, newPath);
}
- // window.location.href = `${window.location.origin}/docs${currentLang.value === 'zh' ? currentVersion.value.link : currentVersion.value.enLink}`.replace(currentDialect.value, val);
}
+function handleHelpClick() {
+ const modelLink = withBase((currentLang.value === 'zh' ? 'zh/' : '') + 'UserGuide/' + currentVersion.value + '/Background-knowledge/Data-Model-and-Terminology' + URL_SUFFIX + '.html');
+ router.push(modelLink);
+}
watch(
() => route.path,
@@ -66,10 +77,89 @@ watch(
} else {
currentLang.value = 'en';
}
- currentVersion.value = getDocVersion(newVal,'latest');
- currentDialect.value = getDialect(newVal,'');
+ currentVersion.value = getDocVersion(newVal, 'latest');
+ currentDialect.value = getDialect(newVal, '');
}
},
{ immediate: true },
);
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/src/.vuepress/utils/getDocVersion.ts b/src/.vuepress/utils/getDocVersion.ts
index ebf261c87..cfd6359bd 100644
--- a/src/.vuepress/utils/getDocVersion.ts
+++ b/src/.vuepress/utils/getDocVersion.ts
@@ -55,3 +55,5 @@ export const getDialect = (path = '', defaultValue = '') => {
}
return defaultValue;
};
+
+export const URL_SUFFIX = '_apache';
\ No newline at end of file