fix: 隐藏侧边栏菜单滚动条
- tailwind.config 添加 scrollbar-hide 工具类插件 - SidebarNav nav 元素添加 scrollbar-hide class
This commit is contained in:
@@ -160,7 +160,7 @@ export default function SidebarNav({ mobileOpen, onClose }: { mobileOpen: boolea
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 导航菜单 */}
|
{/* 导航菜单 */}
|
||||||
<nav className="flex-1 overflow-y-auto py-3 px-2 space-y-3">
|
<nav className="flex-1 overflow-y-auto py-3 px-2 space-y-3 scrollbar-hide">
|
||||||
{navGroups.map((group, idx) => {
|
{navGroups.map((group, idx) => {
|
||||||
const isExpanded = expandedGroups.has(group.title)
|
const isExpanded = expandedGroups.has(group.title)
|
||||||
const hasActiveItem = group.items.some(item => isActive(item.path))
|
const hasActiveItem = group.items.some(item => isActive(item.path))
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import typography from '@tailwindcss/typography'
|
import typography from '@tailwindcss/typography'
|
||||||
|
import plugin from 'tailwindcss/plugin'
|
||||||
|
|
||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
export default {
|
export default {
|
||||||
@@ -85,5 +86,16 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [typography],
|
plugins: [
|
||||||
|
typography,
|
||||||
|
plugin(({ addUtilities }) => {
|
||||||
|
addUtilities({
|
||||||
|
'.scrollbar-hide': {
|
||||||
|
'scrollbar-width': 'none',
|
||||||
|
'-ms-overflow-style': 'none',
|
||||||
|
'&::-webkit-scrollbar': { display: 'none' },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user