mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-24 07:26:50 +00:00
🕶 侧边栏微调
This commit is contained in:
@@ -50,14 +50,14 @@ const DefaultLayout = ({ tags, posts, page, currentTag, ...customMeta }) => {
|
||||
// if (ref) {
|
||||
// ref.remove()
|
||||
// }
|
||||
window.addEventListener('resize', resizeWindowHideToc)
|
||||
resizeWindowHideToc()
|
||||
window.addEventListener('resize', changeColumnCount)
|
||||
changeColumnCount()
|
||||
return () => {
|
||||
window.removeEventListener('resize', resizeWindowHideToc)
|
||||
window.removeEventListener('resize', changeColumnCount)
|
||||
}
|
||||
}, [])
|
||||
|
||||
const resizeWindowHideToc = throttle(() => {
|
||||
const changeColumnCount = throttle(() => {
|
||||
if (window.innerWidth > 2500) {
|
||||
changeColumn(5)
|
||||
} else if (window.innerWidth > 1800) {
|
||||
|
||||
Reference in New Issue
Block a user