File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
docs/.vitepress/theme/versioning Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,6 @@ let oldVersionList: string[] = [];
1919const versions = ref <string []>([]);
2020const docsPath = ref (" " );
2121
22- onMounted (() => {
23- if (isLatest .value ) {
24- docsPath .value = window .location .pathname ;
25- } else {
26- docsPath .value = window .location .pathname .split (` /${ currentVersion .value }/ ` )[1 ];
27- }
28- });
29-
3022function refresh() {
3123 let version = latestVersion .value ;
3224 let refreshPage = false ;
@@ -49,6 +41,12 @@ function refresh() {
4941 versions .value = versionList ;
5042 isOld .value = oldVersionList .includes (version );
5143
44+ if (isLatest .value ) {
45+ docsPath .value = window .location .pathname ;
46+ } else {
47+ docsPath .value = window .location .pathname .split (` /${ currentVersion .value }/ ` )[1 ];
48+ }
49+
5250 if (refreshPage ) {
5351 window .location .pathname = isLatest .value ? " /" : ` /${ version }/ ` ;
5452 window .location .reload ();
You can’t perform that action at this time.
0 commit comments