Skip to content

Commit

Permalink
chore(sfc-playground): highlight the active version in dropdown (#9045)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea authored Dec 11, 2023
1 parent ef432bd commit 376dac4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/sfc-playground/src/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const vueVersion = ref(`@${currentCommit}`)
async function setVueVersion(v: string) {
vueVersion.value = `loading...`
await store.setVueVersion(v)
vueVersion.value = `v${v}`
vueVersion.value = v
}
function resetVueVersion() {
Expand Down
8 changes: 6 additions & 2 deletions packages/sfc-playground/src/VersionSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ onMounted(() => {

<ul class="versions" :class="{ expanded }">
<li v-if="!versions"><a>loading versions...</a></li>
<li v-for="version of versions">
<a @click="setVersion(version)">v{{ version }}</a>
<li v-for="ver of versions" :class="{ active: ver === version }">
<a @click="setVersion(ver)">v{{ ver }}</a>
</li>
<div @click="expanded = false">
<slot />
Expand Down Expand Up @@ -111,4 +111,8 @@ onMounted(() => {
border-top: 6px solid #aaa;
margin-left: 8px;
}
.versions .active a {
color: var(--green);
}
</style>

0 comments on commit 376dac4

Please sign in to comment.