chore(sfc-playgroud): highlight the commit and latest version when active in dropdown (#11445)

This commit is contained in:
wzc520pyfm 2024-07-29 09:43:25 +08:00 committed by GitHub
parent c803e6a107
commit 8e052eecf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -80,7 +80,7 @@ function toggleDark() {
pkg="vue"
label="Vue Version"
>
<li>
<li :class="{ active: vueVersion === `@${currentCommit}` }">
<a @click="resetVueVersion">This Commit ({{ currentCommit }})</a>
</li>
<li>

View File

@ -74,7 +74,12 @@ onMounted(() => {
<ul class="versions" :class="{ expanded }">
<li v-if="!versions"><a>loading versions...</a></li>
<li v-for="ver of versions" :class="{ active: ver === version }">
<li
v-for="(ver, index) of versions"
:class="{
active: ver === version || (version === 'latest' && index === 0),
}"
>
<a @click="setVersion(ver)">v{{ ver }}</a>
</li>
<div @click="expanded = false">