@@ -50,11 +50,13 @@ const prod = useRouteQuery<string, boolean>('prod', 'false', {
5050 transform: stringToBooleanTransformer ,
5151})
5252
53- const currentHref = shallowRef (window ?.location ?.href )
53+ const r = useRequestURL ()
54+
55+ const currentHref = shallowRef (r .href )
5456const route = useRoute ()
5557
5658watch (() => route .fullPath , () => {
57- currentHref .value = window ?. location ? .href
59+ currentHref .value = r .href
5860})
5961
6062const issueLink = computed (() => {
@@ -63,18 +65,20 @@ const issueLink = computed(() => {
6365 </script >
6466
6567<template >
66- <UApp >
67- <header class = " flex items-center justify-between px-6 h-(--header-height) " >
68- <div class = " flex gap-2 items-center " >
68+ <div >
69+ <UHeader >
70+ <template # left >
6971 <UIcon name =" i-logos-vueuse" class =" size-8" />VueUse Playground
70- </div >
71-
72- <div class =" hidden lg:flex gap-2 items-center" >
73- <USwitch v-model =" ssr" label =" SSR" />
74- <USwitch v-model =" prod" label =" Prod" />
75- <USelectMenu v-model =" vueUseVersion" :items =" vueUseVersionsSorted" class =" w-32" icon =" i-logos-vueuse" :loading =" loadingVersions" />
76- <USelectMenu v-model =" vueVersion" :items =" vueVersionsSorted" class =" w-32" icon =" i-logos-vue" :loading =" loadingVersions" />
77- <UButton icon =" i-lucide-refresh-ccw" size =" md" color =" primary" variant =" soft" @click =" () => fetchVersions()" />
72+ </template >
73+
74+ <template #right >
75+ <div class =" hidden lg:flex gap-2 items-center" >
76+ <USwitch v-model =" ssr" label =" SSR" />
77+ <USwitch v-model =" prod" label =" Prod" />
78+ <USelectMenu v-model =" vueUseVersion" virtualize :items =" vueUseVersionsSorted" class =" w-32" icon =" i-logos-vueuse" :loading =" loadingVersions" />
79+ <USelectMenu v-model =" vueVersion" virtualize :items =" vueVersionsSorted" class =" w-32" icon =" i-logos-vue" :loading =" loadingVersions" />
80+ <UButton icon =" i-lucide-refresh-ccw" size =" md" color =" primary" variant =" soft" @click =" () => fetchVersions()" />
81+ </div >
7882 <UButton
7983 color =" neutral" variant =" ghost"
8084 :icon =" colorMode.preference === 'dark' ? 'i-heroicons-moon' : 'i-heroicons-sun'"
@@ -93,68 +97,32 @@ const issueLink = computed(() => {
9397 />
9498 </UTooltip >
9599 <UTooltip text =" Report an issue on GitHub" >
96- <ClientOnly >
97- <UButton
98- color =" neutral"
99- variant =" ghost"
100- :to =" issueLink"
101- target =" _blank"
102- icon =" i-pajamas-issue-new"
103- aria-label =" Issue via GitHub"
104- />
105- </ClientOnly >
106- </UTooltip >
107- </div >
108- <div class =" lg:hidden" >
109- <UButton
110- color =" neutral" variant =" ghost"
111- :icon =" colorMode.preference === 'dark' ? 'i-heroicons-moon' : 'i-heroicons-sun'"
112- aria-label =" color mode"
113- @click =" toggleColorMode"
114- />
115- <UTooltip text =" Open on GitHub" >
116100 <UButton
117101 color =" neutral"
118102 variant =" ghost"
119- to =" https://github.com/vueuse "
103+ : to =" issueLink "
120104 target =" _blank"
121- icon =" i-simple-icons-github "
122- aria-label =" GitHub"
105+ icon =" i-pajamas-issue-new "
106+ aria-label =" Issue via GitHub"
123107 />
124108 </UTooltip >
125- <USlideover title =" Settings" >
126- <UButton icon =" i-lucide-menu" color =" neutral" variant =" outline" />
127- <template #body >
128- <section class =" flex flex-col gap-2 items-center justify-center" >
129- <div class =" flex gap-2" >
130- <USwitch v-model =" ssr" label =" SSR" />
131- <USwitch v-model =" prod" label =" Prod" />
132- </div >
133- <div class =" flex gap-2" >
134- <USelectMenu v-model =" vueUseVersion" :items =" vueUseVersionsSorted" class =" w-32" icon =" i-logos-vueuse" :loading =" loadingVersions" />
135- <USelectMenu v-model =" vueVersion" :items =" vueVersionsSorted" class =" w-32" icon =" i-logos-vue" :loading =" loadingVersions" />
136- <UButton icon =" i-lucide-refresh-ccw" size =" md" color =" primary" variant =" soft" @click =" () => fetchVersions()" />
137- </div >
138- <ClientOnly >
139- <UButton
140- color =" neutral"
141- variant =" ghost"
142- :to =" issueLink"
143- target =" _blank"
144- icon =" i-pajamas-issue-new"
145- aria-label =" Issue via GitHub"
146- >
147- Report an issue on GitHub
148- </UButton >
149- </ClientOnly >
150- </section >
151- </template >
152- </USlideover >
153- </div >
154- </header >
155-
156- <main class =" h-[calc(100vh-var(--header-height))]" >
157- <NuxtPage />
158- </main >
159- </UApp >
109+ </template >
110+ <template #body >
111+ <section class =" flex flex-col gap-2 items-center justify-center" >
112+ <div class =" flex gap-2" >
113+ <USwitch v-model =" ssr" label =" SSR" />
114+ <USwitch v-model =" prod" label =" Prod" />
115+ </div >
116+ <div class =" flex gap-2" >
117+ <USelectMenu v-model =" vueUseVersion" :items =" vueUseVersionsSorted" class =" w-32" icon =" i-logos-vueuse" :loading =" loadingVersions" />
118+ <USelectMenu v-model =" vueVersion" :items =" vueVersionsSorted" class =" w-32" icon =" i-logos-vue" :loading =" loadingVersions" />
119+ <UButton icon =" i-lucide-refresh-ccw" size =" md" color =" primary" variant =" soft" @click =" () => fetchVersions()" />
120+ </div >
121+ </section >
122+ </template >
123+ </UHeader >
124+ <UMain class =" h-[calc(100vh-var(--ui-header-height))]" >
125+ <slot />
126+ </UMain >
127+ </div >
160128</template >
0 commit comments