Skip to content

Commit 376dac4

Browse files
authored
chore(sfc-playground): highlight the active version in dropdown (#9045)
1 parent ef432bd commit 376dac4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/sfc-playground/src/Header.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const vueVersion = ref(`@${currentCommit}`)
2424
async function setVueVersion(v: string) {
2525
vueVersion.value = `loading...`
2626
await store.setVueVersion(v)
27-
vueVersion.value = `v${v}`
27+
vueVersion.value = v
2828
}
2929
3030
function resetVueVersion() {

packages/sfc-playground/src/VersionSelect.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ onMounted(() => {
7474

7575
<ul class="versions" :class="{ expanded }">
7676
<li v-if="!versions"><a>loading versions...</a></li>
77-
<li v-for="version of versions">
78-
<a @click="setVersion(version)">v{{ version }}</a>
77+
<li v-for="ver of versions" :class="{ active: ver === version }">
78+
<a @click="setVersion(ver)">v{{ ver }}</a>
7979
</li>
8080
<div @click="expanded = false">
8181
<slot />
@@ -111,4 +111,8 @@ onMounted(() => {
111111
border-top: 6px solid #aaa;
112112
margin-left: 8px;
113113
}
114+
115+
.versions .active a {
116+
color: var(--green);
117+
}
114118
</style>

0 commit comments

Comments
 (0)