mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
hide some text when screen is small
This commit is contained in:
1 parent
8c4a9ea871
commit
9bfc6614ca
3 files changed
+45
-11
No files matched your search
@@ -11,6 +11,19 @@ defineProps({
|
||||
required: false,
|
||||
},
|
||||
})
|
||||
let showMenu = false
|
||||
const ToggleMenu = () => {
|
||||
console.log(showMenu)
|
||||
showMenu = true
|
||||
console.log(showMenu)
|
||||
}
|
||||
const hideMenu = () => {
|
||||
showMenu = false
|
||||
}
|
||||
const handleItemClick = (item) => {
|
||||
console.log('Clicked:', item)
|
||||
// Add your logic for handling item click here
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div
|
||||
@@ -34,8 +47,27 @@ defineProps({
|
||||
{{ title }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="w-full flex gap-3 items-center justify-end">
|
||||
<div class="w-full flex gap-3 items-center justify-end hidden sm:flex">
|
||||
<component :is="headerComponent" />
|
||||
</div>
|
||||
<button class="flex items-center justify-end sm:hidden h-5 w-5">
|
||||
<font-awesome-icon
|
||||
:icon="['fas', 'bars']"
|
||||
class="text-text-primary h-full w-full"
|
||||
@click="ToggleMenu"
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="showMenu" class="bg-bg-primary w-full h-1/2 z-50">
|
||||
<!-- Menu items -->
|
||||
<ul>
|
||||
<li
|
||||
v-for="item in menuItems"
|
||||
:key="item.id"
|
||||
@click="handleItemClick(item)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user