Skip to content

Commit

Permalink
chore: add icons for versions
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Oct 11, 2023
1 parent b097a1a commit 35b77c8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/online-playground/public/logo-ts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/online-playground/public/logo-vue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 15 additions & 7 deletions packages/online-playground/src/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ function toggleDark() {
<span>Pinia Playground</span>
</h1>
<div class="links">
<VersionSelect
v-model="store.state.typescriptVersion"
pkg="typescript"
label="TypeScript"
/>
<VersionSelect v-model="store.state.typescriptVersion" pkg="typescript">
<template #label>
<img src="/logo-ts.svg" alt="TypeScript" class="version-logo" />
</template>
</VersionSelect>
<!-- <VersionSelect
:model-value="vueVersion"
@update:model-value="setVueVersion"
Expand All @@ -83,8 +83,11 @@ function toggleDark() {
:model-value="store.vueVersion || 'latest'"
@update:model-value="setVueVersion"
pkg="vue"
label="Vue"
/>
>
<template #label>
<img src="/logo-vue.svg" alt="Vue" class="version-logo" />
</template>
</VersionSelect>
<button
title="Toggle development production mode"
class="toggle-dev"
Expand Down Expand Up @@ -269,4 +272,9 @@ h1 img {
.links > * + * {
margin-left: 4px;
}
.version-logo {
height: 1.2em;
margin-right: 4px;
}
</style>
6 changes: 4 additions & 2 deletions packages/online-playground/src/VersionSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const versions = ref<string[]>()
const version = defineModel()
const props = defineProps<{
pkg: string
label: string
label?: string
}>()
async function toggle() {
Expand Down Expand Up @@ -79,7 +79,9 @@ onMounted(() => {
<template>
<div class="version" @click.stop>
<span class="active-version" @click="toggle">
{{ label }}
<slot name="label">
{{ label }}
</slot>
<span class="number">{{ version }}</span>
</span>

Expand Down

0 comments on commit 35b77c8

Please sign in to comment.