![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
落落的前端学习之路
这个作者很懒,什么都没留下…
展开
-
electron项目 用vscode 调试主进程和渲染进程
【代码】css 写0.5px的线。原创 2023-11-24 15:38:22 · 588 阅读 · 0 评论 -
ahooks useVirtualList 滚动条抖动或者数据抖动
懒加载的时候由于不断更新列表项内部的高度,因此就会使浏览器自动触发滚动事件,而滚动事件又触发懒加载的更新,形成死循环,造成自动滚动的问题。在父元素中添加样式overflow-anchor:none就正常了。不知道为啥只有react18,root.render()方式才会有问题。页面内容高度发生变化引起滚动条跳动的问题。浏览器会自动触发onscroll事件,调整滚动条的位置,让滚动条不乱跳动;...原创 2022-08-12 14:22:02 · 1052 阅读 · 0 评论 -
纯前端 导出excel 插件xlsx和file-saver
纯前端 导出excel 插件xlsx原创 2022-06-22 16:49:21 · 518 阅读 · 0 评论 -
react-infinite-scroll-component 第二次加载无法触发next
react-infinite-scroll-component 是一款滚动加载插件,在页面滚动的时候加载数据,在使用过程遇到一个坑。坑的描述: 在页面滚动的时候,infiniteScroll页面数是自动+1,打个比方说,页面加载到第三页,infiniteScroll无法在重新开始计数,而在某些场景中需要重新开始计数,比如说页面在加载完之后,页面进行搜索功能,然后再取消搜索,page number需要重新计数解决方案: 改变infiniteScroll的key值...原创 2022-05-31 14:04:29 · 1828 阅读 · 0 评论 -
全局使用dva dispatch
window.g_app._store.dispatch({ type: 'login/logout', });原创 2021-12-07 15:58:19 · 538 阅读 · 0 评论 -
React 父组件(hooks)调用子组件(calss)方法
父组件(hooks) let richTextRef = {}; <RichText getRichText={getRichText} content={content} onRef={ref => richTextRef = ref} />子组件(class) componentDidMount = () => { this.props.onRef && this.props.onRef(this); }原创 2021-12-07 10:13:29 · 823 阅读 · 0 评论 -
React 父组件和子组件中的方法相互调用
父组件中调用子组件的getTree方法父组件 setFormValue=()=>{ this.TreeList.getTree } <TreeList onSelect={this.setFormValue} onRef={(ref) => { this.TreeList = ref }} />子组件 componentDidMount = () => { this.props.onRef(this); this.getTree().原创 2021-05-20 16:45:45 · 186 阅读 · 0 评论 -
React 学习笔记 —— Ref Hook
用以下三种方式创建 Ref 都可以import React from 'react'export default function Count () { const [count ,setCount] = React.useState(0) const myRef = React.createRef() const myRef2 = React.useRef() // Ref Hook 的方式 const myRef3 = {current: undefined}.转载 2021-05-19 10:16:40 · 165 阅读 · 0 评论