profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/tgioer/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

tgioer/ant-design-mobile 0

A configurable Mobile UI

tgioer/perp-arbitrageur 0

An arbitrage bot that executes automated trading strategies between Perpetual Protocol and FTX

create barnchtaroify/react-vant

branch : fix/date-picker

created branch time in 5 hours

create barnchtaroify/react-vant

branch : fix/date-picker

created branch time in 6 hours

issue commentmallfoundry/taroify

如何自定义主题

目前不能支持

ykrank

comment created time in 9 days

issue commentmallfoundry/taroify

组件Field不能输入name属性

好的,下个版本加上

hellozsh

comment created time in 9 days

push eventmallfoundry/taroify

Tang Zhi

commit sha 70c703246694598c2a48a80f113d406bc23a3ec7

Fix how classnames are imported

view details

Tang Zhi

commit sha bf3bc66399748d6ebe06f54cb10ae5db3e45d21d

Update version to '0.0.12-alpha.6'

view details

push time in 9 days

issue commentNervJS/taro

使用 boundingClientRect 在 useReady 中获得元素的 rect 有时会为 null 的问题

把onReady 放在index 页面中, 或者 nextTick 进行模拟,. 尝试一下

按正常来说,不管用不用 nextTick ,都不应该出现这个问题。

tgioer

comment created time in 10 days

issue commentNervJS/taro

使用 boundingClientRect 在 useReady 中获得元素的 rect 有时会为 null 的问题

把onReady 放在index 页面中, 或者 nextTick 进行模拟,. 尝试一下

试过了,有随机性。

tgioer

comment created time in 10 days

issue commentmallfoundry/taroify

使用tab组件ui有异常

提一个最小仓库,或者最小代码集。看截图看不出来

hellozsh

comment created time in 10 days

issue commentmallfoundry/taroify

Tabbar.Item 组件重命名为 Tabbar.TabItem

https://github.com/mallfoundry/taroify/commit/2680f9111db9e1d4707b81ec155b79d523ba2f4f

tgioer

comment created time in 10 days

issue commentmallfoundry/taroify

Navbar 组件替换 title 类型为 ReactNode

https://github.com/mallfoundry/taroify/commit/ee4246c0490abf3e323dd28b24225405e9c444e1

tgioer

comment created time in 10 days

issue commentmallfoundry/taroify

Sticky 组件需要新增 onChange 事件

https://github.com/mallfoundry/taroify/commit/ef3893cd37066834645ff29b1e455836e8f347ea

tgioer

comment created time in 10 days

issue closedmallfoundry/taroify

Sticky 组件需要新增 onChange 事件

Sticky 组件需要新增 onChange 事件,对外提供组件吸顶状态是否变化。

closed time in 10 days

tgioer

push eventmallfoundry/taroify

akazwz

commit sha c3cedf302e8afb9c80be84f32cecbc55e3481668

bug fix

view details

tangzhi

commit sha 834f4fea116189c3c88b8dceef915883a365ed0a

!3 Rate 半星颜色bug fix Merge pull request !3 from akazwz/master

view details

Tang Zhi

commit sha ef3893cd37066834645ff29b1e455836e8f347ea

Add onChange event

view details

Tang Zhi

commit sha 6f2e3557c7f81f560913b546f7d60a59d7dddd95

Merge branch 'feature/sticky'

view details

Tang Zhi

commit sha ee4246c0490abf3e323dd28b24225405e9c444e1

Replace string with ReactNode

view details

Tang Zhi

commit sha 520a3ee626e13182ddfc34a90d5ddfb46aed3260

Remove nextTick

view details

Tang Zhi

commit sha 401e87d0e238d5ee5b299a6b7ebba9aa6319c0cf

Merge branch 'fix/tabs'

view details

Tang Zhi

commit sha 2680f9111db9e1d4707b81ec155b79d523ba2f4f

Rename Tabbar.Item to Tabbar.TabItem

view details

Tang Zhi

commit sha 02716d6fceb03306e0bf8da74371ad94b7d8f32f

Rename Tabbar.Item to Tabbar.TabItem

view details

Tang Zhi

commit sha b01f276f6ad8b85ed2be5208431e5edeb813b95d

Update version to '0.0.12-alpha.5'

view details

push time in 10 days

issue openedNervJS/taro

使用 boundingClientRect 在 useReady 中获得元素的 rect 有时会为 null 的问题

<!-- 请不要删除自动生成的 Issue 标签 --> <!-- 请不要删除自动生成的 Issue 标签 -->

相关平台

微信小程序

复现仓库

https://github.com/taroify/taro336-rect 小程序基础库: 2.19.3 使用框架: React

复现步骤

使用 boundingClientRect 在 useReady 中获得元素的 rect 有时会为 null 的问题

function GetRect() {
  const rootRef = useRef<TaroElement>()
  const {objects} = useContext(RectContext)

  useReady(() => {
    createSelectorQuery()
      .select("#"   rootRef.current?.uid)
      .boundingClientRect((rect) => {
        console.log(rootRef.current, rect)
      })
      .exec()
  })

  return (
    <View ref={rootRef}>
      {
        objects.map(num => (<Text key={num}>Num:{num}</Text>))
      }
    </View>
  )
}

这个问题在微信小程序中会存在一定的随机性问题,大概率的发生方式是:

  • 清空编译缓存再编译
  • 创建多个组件
export default function Index() {
  return (
    <RectContext.Provider
      value={{
        objects: [1, 2, 3, 4, 5, 6, 7]
      }}
    >
      <View className="index">
        <GetRect/>
        <GetRect/>
        <GetRect/>
        <GetRect/>
        <GetRect/>
        <GetRect/>
        <GetRect/>
        <GetRect/>
        <GetRect/>
      </View>
    </RectContext.Provider>
  )
}

weapp 中的效果

weapp

期望结果

期望的结果是在 useReady 获得 rect 不为 null。

实际结果

期望的结果是在 useReady 获得 rect为 null。

环境信息

� Taro v3.3.6


  Taro CLI 3.3.6 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.17.1 - C:\Programs\nodejs\node-v14.17.1-win-x64\node.EXE
      Yarn: 1.22.11 - C:\Programs\nodejs\node\yarn.CMD
      npm: 6.14.13 - C:\Programs\nodejs\node-v14.17.1-win-x64\npm.CMD

<!-- generated by taro-issues. 请勿修改或删除此行注释 --><!--labels=T-weapp,V-3,F-react-->

created time in 10 days

issue openedmallfoundry/taroify

Sticky 组件需要新增 onChange 事件

Sticky 组件需要新增 onChange 事件,对外提供组件吸顶状态是否变化。

created time in 14 days

push eventmallfoundry/taroify

Tang Zhi

commit sha 7f3ae7fc74a4dad32a56d5486d90b9e6e5cfe55a

Add clearIcon prop

view details

Tang Zhi

commit sha 39357a30fd66998c46ff6dc746492f3343ead3ab

Export types of Field

view details

Tang Zhi

commit sha 2acc5cb5cb3fbfdc112863f92089ca2b43c68ee7

Add a Search component

view details

Tang Zhi

commit sha 57daaf65b15498f7df0270eca9c8811d89cef37f

Fix publish date of 'v0.0.11-alpha.0'

view details

Tang Zhi

commit sha 08b4d6f4818ea7045f2720e359d701131e78b194

Add inset prop of Cell.Group

view details

Tang Zhi

commit sha 2b665fda0f27dc2924f0506fa39e6c1c3580aded

Update version to '0.0.12-alpha.0'

view details

Tang Zhi

commit sha 7b2afdacc090fe4612f905c3547620f505ab53f1

Add 'babel.config.js'

view details

Tang Zhi

commit sha 1e635c4e95da33ac6a897c1773b401c2e8eed70f

Fix 'taroify-hairline-unset' to 'taroify-hairline--unset'

view details

Tang Zhi

commit sha f1aeee1cad1ee520c1675483d7e86e13282f5383

Fix containerRef is null

view details

Tang Zhi

commit sha e846770856b5e822d8d6be97e2275a187cf661ce

Add onClick event of NavLeft and NavRight

view details

Tang Zhi

commit sha c6d2630d0774d7293f6748c2def18dad86d07441

Merge branch 'feature/navbar'

view details

Tang Zhi

commit sha b08ab6e5d25562e12ef0d543d1925c26a7686edf

Fix text to children prop

view details

Tang Zhi

commit sha 84046dda75cffb40442035ceb0921753c8696782

Add icon prop of Search

view details

Tang Zhi

commit sha 757afc124bfa123c281b10e5ffac85585b968e89

Merge branch 'feature/navbar'

view details

Tang Zhi

commit sha fda52d5f62fa25267988d07841ea3843c5a1ca99

Merge branch 'feature/search'

view details

Tang Zhi

commit sha 6225351f3381a3f77ff2d63bade9c6a8afaf260c

Update version to '0.0.12-alpha.1'

view details

Tang Zhi

commit sha c32821431bac9283e5455634c87e88a304197936

Fix bottom of root view of weapp is undefined

view details

Tang Zhi

commit sha 868941cdf211371ce8861a4eb5594f73fadb553f

Order import

view details

Tang Zhi

commit sha d7b1522dcb4df8bba8da272ff1180357d769c2bb

Update version to '0.0.12-alpha.2'

view details

Tang Zhi

commit sha 00304e2554db0c12a455174c3e2e4fab820251a8

Update version of babel to '7.12.13'

view details

push time in 14 days

issue closedmallfoundry/taroify

完善 Tabbar 组件

Tabbar 组件新增 fixed, placeholder, bordered 属性。 Tabbar.Item 组件新增 badge 属性。

closed time in 14 days

tgioer

issue closedmallfoundry/taroify

按钮貌似没有继承原生属性?

例如利用按钮触发用户信息手机号获取,貌似button原属性没怎么支持

closed time in 14 days

itmanyong

issue commentmallfoundry/taroify

按钮貌似没有继承原生属性?

v0.0.12-alpha.4 新增了小程序的属性

itmanyong

comment created time in 14 days

issue openedmallfoundry/taroify

完善 Tabbar 组件

Tabbar 组件增加 fixed, placeholder, bordered 属性。 Tabbar.Item 组件增加 badge 属性。

created time in 14 days

issue closedmallfoundry/taroify

下拉PullRefresh 刷新结合list 在微信开发者工具,滚动条滑至底部 滚动触发加载数据,失效

import React, { useState, useEffect, useRef } from "react"; import { View } from "@tarojs/components"; import { useDidHide, useDidShow } from "@tarojs/taro"; import { Tabs, PullRefresh, List, Loading, Empty } from "@taroify/core"; import "@taroify/core/pull-refresh/index.scss"; import "@taroify/core/Tabs/index.scss"; import "@taroify/core/Empty/index.scss"; import "@taroify/core/loading/index.scss"; import "@taroify/core/List/index.scss";

function Information() { const init = async () => { console.log("请求 数据 >>> information"); }; useEffect(() => { init(); }, []);

useDidShow(() => { console.log("componentDidShow"); });

useDidHide(() => { console.log("componentDidHide"); }); let list = [ { label: "事件上报" }, { label: "全民参与" }, { label: "建议上报" }, ]; const [hasMore, setHasMore] = useState(true); const listRef = useRef([]); const [loading, setLoading] = useState(false); const [refreshing, setRefreshing] = useState(false); const [activeKey, setActiveKey] = useState("0"); // 图标处理 // Tabs切换事件 function onChangeTabs(key) { setActiveKey(key); onRefresh(); // changeActiveKey(key); } // 下拉刷新 function onRefresh() { setRefreshing(true); setLoading(false); listRef.current = []; onLoad(); } // 滚动刷新 const onLoad = () => { setLoading(true); setTimeout(() => { setRefreshing(false); for (let i = 0; i < 10; i++) { const id = listRef.current.length + 1; listRef.current.push({ text: "111111111", img: '', id: i % 2 != 0 || false, Time: "2020-10-05", }); } setLoading(false); setHasMore(listRef.current.length < 80); }, 1000); }; console.log(listRef.current, "=listRef.current=="); return ( <View className="InformationBody"> <Tabs sticky activeKey={activeKey} ellipsis={false} onChange={({ key }) => onChangeTabs(key)} > {list.map((item, index) => ( <Tabs.TabPane key={index} title={item.label}> <PullRefresh loading={refreshing} onRefresh={onRefresh}> <List immediateCheck={false} immediate-check={false} loading={loading} hasMore={hasMore} onLoad={onLoad} offset={500} > {listRef.current.map((item, Index) => ( // <Cell item={item} Index={Index} key={Index}></Cell> <View key={Index}>{Index}</View> ))} <List.Placeholder> {loading && <Loading>加载中... </Loading>} {!hasMore && "没有更多了"} </List.Placeholder> </List> </PullRefresh> </Tabs.TabPane> ))} </Tabs> </View> ); } export default Information;

closed time in 15 days

z10026393

issue commentmallfoundry/taroify

下拉PullRefresh 刷新结合list 在微信开发者工具,滚动条滑至底部 滚动触发加载数据,失效

Taro 3.3.6 已修复。https://github.com/NervJS/taro/pull/10188

z10026393

comment created time in 15 days