mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
fix: header components in the middle
This commit is contained in:
1 parent
453bfb7f1e
commit
bdf757c2d4
1 file changed
+6
-2
@@ -12,6 +12,7 @@ defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
const menuOpen = ref(false)
|
const menuOpen = ref(false)
|
||||||
|
const windowWidth = window.innerWidth < 768
|
||||||
const toggleMenu = () => {
|
const toggleMenu = () => {
|
||||||
menuOpen.value = !menuOpen.value
|
menuOpen.value = !menuOpen.value
|
||||||
}
|
}
|
||||||
@@ -38,12 +39,15 @@ const toggleMenu = () => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="w-full flex flex-col gap-3 items-center justify-end sm:w-auto sm:block sm:ml-6"
|
class="w-full flex flex-col items-center justify-end sm:w-auto sm:block sm:ml-6"
|
||||||
:class="{ hidden: !menuOpen }"
|
:class="{ hidden: !menuOpen }"
|
||||||
>
|
>
|
||||||
<component :is="headerComponent" />
|
<component :is="headerComponent" />
|
||||||
</div>
|
</div>
|
||||||
<div :class="{ 'w-full flex justify-end pb-3': menuOpen }">
|
<div
|
||||||
|
v-if="windowWidth"
|
||||||
|
:class="{ 'w-full flex justify-end pb-3': menuOpen }"
|
||||||
|
>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="flex items-center h-5 w-5 rounded-md sm:hidden"
|
class="flex items-center h-5 w-5 rounded-md sm:hidden"
|
||||||
|
|||||||
Reference in new issue
Block a user