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[] = [];
19
19
const versions = ref <string []>([]);
20
20
const docsPath = ref (" " );
21
21
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
-
30
22
function refresh() {
31
23
let version = latestVersion .value ;
32
24
let refreshPage = false ;
@@ -49,6 +41,12 @@ function refresh() {
49
41
versions .value = versionList ;
50
42
isOld .value = oldVersionList .includes (version );
51
43
44
+ if (isLatest .value ) {
45
+ docsPath .value = window .location .pathname ;
46
+ } else {
47
+ docsPath .value = window .location .pathname .split (` /${ currentVersion .value }/ ` )[1 ];
48
+ }
49
+
52
50
if (refreshPage ) {
53
51
window .location .pathname = isLatest .value ? " /" : ` /${ version }/ ` ;
54
52
window .location .reload ();
You can’t perform that action at this time.
0 commit comments