上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 29 下一页
摘要: 先上代码: import React from 'react'; export default class ListArea extends React.Component { state = { currentIndex: 0, interval: 3000, suspend: false }; 阅读全文
posted @ 2020-09-16 14:47 herry菌 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 这是个类似表格的布局,数据超出屏幕条数,因此需要每秒向上滚动一格。 使用: 表头渲染: <div className={s.head}> { structure.map(si => <div key={si.key} className={s.col} style={{width:si.width} 阅读全文
posted @ 2020-09-16 13:15 herry菌 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 效果:鼠标移入自动向上滚动,鼠标移出停止滚动 滚动区域设置onMouseOver与onMouseOut事件。listEle表示需要滚动的列表dom,设置2个是为了达到无缝滚动效果。 onMouseOver清除定时器timer,达到停止滚动效果。 onMouseOut打开定时器timer,每100ms 阅读全文
posted @ 2020-09-16 12:36 herry菌 阅读(1160) 评论(0) 推荐(0) 编辑
摘要: div滚动条可以做多个区块的多内容展示 使用方式: import Scrollbar from '../common/scrollbar' <Scrollbar className={styles.body} scroll={this.onScroll}> {内部内容} </Scrollbar> 引 阅读全文
posted @ 2020-09-15 15:34 herry菌 阅读(510) 评论(0) 推荐(0) 编辑
摘要: 项目中我一般用的还是react15的比较多,偶尔接触react16,目前使用的大多是生命周期的区别,16新增了几个生命周期。 static getDerivedStateFromProps:用于代替componentReceiveProps。是个静态方法。 父组件传入子组件的属性更新时,同步更新子组 阅读全文
posted @ 2020-09-13 17:19 herry菌 阅读(906) 评论(0) 推荐(0) 编辑
摘要: 子组件要调用父组件的方法: 父组件传入子组件要调的方法 <Child fun={this.fun.bind(this)}> 子组件可通过props直接调用 this.props.fun(xx) 父组件要调用子组件的方法: 父组件中给子组件设置onRef事件,并设置调用名=ref <Child onR 阅读全文
posted @ 2020-09-12 13:59 herry菌 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 头部引入国际化组件和zh_CN import {ConfigProvider} from 'antd'; import zh_CN from 'antd/es/locale/zh_CN'; 在组件外层放上 <ConfigProvider locale={zh_CN}></ConfigProvider 阅读全文
posted @ 2020-08-10 18:40 herry菌 阅读(1512) 评论(0) 推荐(0) 编辑
摘要: 需要2层div,外层是下方半透明的,内层是不透明的进度 外层css background-image: linear-gradient(90deg, rgba(1, 255, 255, 0.25) 60%, transparent 0); background-size: 0.20833vw; 内层 阅读全文
posted @ 2020-07-17 11:12 herry菌 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 在项目的根目录,右键选择 Git Bash 进入命令行; 在命令行输入: touch .gitignore 生成 .gitignore 文件; 在文件中输入过滤信息,过滤规则如下: node_modules/ 表示过滤这个文件夹 *.zip 过滤zip后缀文件 demo.html 过滤该文件 我的项 阅读全文
posted @ 2020-07-12 18:29 herry菌 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 整改中:目前项目使用umi.js+插件的方式,还未上线:git:https://gitee.com/wuhairui1/wuhairui/tree/bilibili/ git地址:https://e.coding.net/a18969054220/herry/bilibili_Time_SC.git 阅读全文
posted @ 2020-07-12 16:59 herry菌 阅读(330) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 29 下一页