🐞 fix(首页左侧菜单):漏了个[]符号
This commit is contained in:
parent
35f3bb4286
commit
18c46e1b17
@ -61,6 +61,21 @@ const SideBar = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
Taro.nextTick(() => {
|
||||||
|
const query = Taro.createSelectorQuery()
|
||||||
|
query.select('.side_bar_select').boundingClientRect((rect) => {
|
||||||
|
console.log('rect::', rect)
|
||||||
|
const clientHeight = rect.height
|
||||||
|
const clientWidth = rect.width
|
||||||
|
const ratio = 750 / clientWidth
|
||||||
|
const height = clientHeight * ratio
|
||||||
|
num_half.current = Math.ceil(height / 2 / heightItem)
|
||||||
|
init()
|
||||||
|
}).exec()
|
||||||
|
})
|
||||||
|
}, [])
|
||||||
|
|
||||||
const clickEvent = ({ item, index }: { item; index: number }) => {
|
const clickEvent = ({ item, index }: { item; index: number }) => {
|
||||||
setSelected(item.id)
|
setSelected(item.id)
|
||||||
sideBarOnClick?.(item)
|
sideBarOnClick?.(item)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user