Skip to content

Commit 06a2c42

Browse files
authored
Merge pull request #90 from datasharingframework/dsf.dev_restructuring_2.0
replaced document.querySelector
2 parents ff11250 + 32bfc06 commit 06a2c42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/src/.vuepress/layouts/PageLayout.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<script setup lang="ts">
2-
// import ParentLayout from '@vuepress/theme-default/layouts/Layout.vue'
32
import { Layout as ParentLayout, PageContent } from 'vuepress-theme-hope/client'
43
import { useRoute, useRouter } from "vue-router";
54
import { ref, onMounted } from 'vue'
65
76
const version = ref("");
7+
const latestVersion = "v1.8.0";
88
99
1010
function 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

Comments
 (0)