11<script setup lang="ts">
2- // import ParentLayout from '@vuepress/theme-default/layouts/Layout.vue'
32import { Layout as ParentLayout , PageContent } from ' vuepress-theme-hope/client'
43import { useRoute , useRouter } from " vue-router" ;
54import { ref , onMounted } from ' vue'
65
76const version = ref (" " );
7+ const latestVersion = " v1.8.0" ;
88
99
1010function setVersionBasedOnCurrentPath() : void {
@@ -13,7 +13,7 @@ function setVersionBasedOnCurrentPath() : void {
1313 const firstSlash = input .indexOf (" /" );
1414 var result = firstSlash !== - 1 ? input .slice (0 , firstSlash ) : input ;
1515 if (result === " latest" ) {
16- result = document . querySelector ( " #version-select > option[latest='true'] " ). value ;
16+ result = latestVersion ;
1717 }
1818 version .value = result ;
1919
@@ -39,7 +39,7 @@ function navigateToNewVersion() {
3939 const input = route .path .substring (' /operations/' .length );
4040 const firstSlash = input .indexOf (" /" );
4141 const result = firstSlash !== - 1 ? input .slice (firstSlash + 1 ) : " " ;
42- if (version .value === document . querySelector ( " #version-select > option[latest='true'] " ). value ) {
42+ if (version .value === latestVersion ) {
4343 router .push (' /operations/' + " latest" + " /" + result );
4444 } else {
4545 router .push (' /operations/' + version .value + " /" + result );
@@ -55,7 +55,7 @@ function navigateToNewVersion() {
5555 <div class =" version-selector" v-if =" route.path.startsWith('/operations/')" >
5656 <label class =" vp-sidebar-header" for =" version-select" ><strong >Version:</strong > </label >
5757 <select id =" version-select" class =" vp-sidebar-header" v-model =" version" @change =" navigateToNewVersion" >
58- <option value =" v1.8.0" latest = " true " >latest (1.8.0)</option >
58+ <option value =" v1.8.0" >latest (1.8.0)</option >
5959 <option value =" v1.7.1" >1.7.1</option >
6060 <option value =" v1.7.0" >1.7.0</option >
6161 <option value =" v1.6.0" >1.6.0</option >
0 commit comments