king 1 year ago
parent 8f104e2a54
commit ae57654a46
  1. 4
      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(() => {
setTimeout(() => {
const query = Taro.createSelectorQuery() const query = Taro.createSelectorQuery()
query.select('#childrenNode').boundingClientRect((res) => { query.select('#childrenNode').boundingClientRect((res) => {
if (!Array.isArray(res)) { if (!Array.isArray(res)) {
if (res.height !== 240) { if (res.height !== 240) {
console.log({childrenNode: res}) console.log({childrenNode: res})
setUltra(pageHeight * .45 < res.height) setUltra(pageHeight * .45 <= res.height)
} }
} }
}).exec() }).exec()
}, 300)
}, [children]) }, [children])
Taro.useReady(() => { Taro.useReady(() => {

Loading…
Cancel
Save