king 1 year ago
parent 8f104e2a54
commit ae57654a46
  1. 18
      src/pages/preview/brand/article/article.tsx

@ -21,15 +21,17 @@ const article: FC = () => {
const {children} = useMemo(() => parse(articleInfo?.content || ''), [articleInfo]) const {children} = useMemo(() => parse(articleInfo?.content || ''), [articleInfo])
useEffect(() => { useEffect(() => {
const query = Taro.createSelectorQuery() setTimeout(() => {
query.select('#childrenNode').boundingClientRect((res) => { const query = Taro.createSelectorQuery()
if (!Array.isArray(res)) { query.select('#childrenNode').boundingClientRect((res) => {
if (res.height !== 240) { if (!Array.isArray(res)) {
console.log({childrenNode: res}) if (res.height !== 240) {
setUltra(pageHeight * .45 < res.height) console.log({childrenNode: res})
setUltra(pageHeight * .45 <= res.height)
}
} }
} }).exec()
}).exec() }, 300)
}, [children]) }, [children])
Taro.useReady(() => { Taro.useReady(() => {

Loading…
Cancel
Save