随笔分类 -  1 前端:React 技术栈

antd中Table组件,配置固定列
摘要:Table配置属性: scroll={{ x: true, }} Table的columns属性对应的数组中,配置各列fixed fixed: 'right' 如果使用TypeScript: 先引入FixedType: import { FixedType } from 'rc-table/lib/ 阅读全文

posted @ 2024-12-18 17:44 cag2050 阅读(44) 评论(0) 推荐(0) 编辑

useEffect的第二个参数使用
摘要:https://juejin.cn/post/7083308347331444750#heading-7 阅读全文

posted @ 2024-04-28 11:09 cag2050 阅读(4) 评论(0) 推荐(0) 编辑

React V16.x 生命周期调整
摘要:旧声明周期: table th:nth of type(5) { width: 400px; } 生命周期 | 属于阶段 | 调用次数 | 是否可以setState | 作用 | | | | getDefaultProps | 创建阶段(Mounting) | 1次(全局调用1次) | 不可以 | 阅读全文

posted @ 2018-09-23 15:09 cag2050 阅读(657) 评论(0) 推荐(0) 编辑

react-router、react-router-dom、react-router-native 关系
摘要:react router 为 React Router 提供核心路由功能,但是你不需要直接安装 react router; 如果你写浏览器端应用,你应该安装 react router dom; 如果你写 React Native 应用,你应该安装 react router native; 当你安装 阅读全文

posted @ 2018-09-04 11:45 cag2050 阅读(1207) 评论(0) 推荐(0) 编辑

create-react-app-typescript 知识点
摘要:github:https://github.com/wmonk/create react app typescript 报错: 原因:import名称排序问题,要求按照字母从小到大排序;修改rules的规则“ordered imports”为false即可。 解决:https://cdn2.jian 阅读全文

posted @ 2018-08-29 15:54 cag2050 阅读(937) 评论(0) 推荐(0) 编辑

gaea-basic-components 知识点
摘要:github 地址:https://github.com/ascoders/gaea basic components 阅读全文

posted @ 2018-08-26 12:03 cag2050 阅读(223) 评论(0) 推荐(0) 编辑

gaea-editor 知识点
摘要:github 地址:https://github.com/ascoders/gaea editor 阅读全文

posted @ 2018-08-26 12:02 cag2050 阅读(362) 评论(0) 推荐(0) 编辑

React 中的 Component、PureComponent、无状态组件 之间的比较
摘要:React 中的 Component、PureComponent、无状态组件之间的比较 table th:first of type { width: 150px; } 组件类型 | 说明 | React.createClass | 不使用ES6语法,只能使用 React.createClass 来 阅读全文

posted @ 2018-08-17 14:33 cag2050 阅读(1213) 评论(1) 推荐(0) 编辑

create-react-app 搭建的项目中,使用 CSS Modules
摘要:create react app 搭建的项目中,使用 CSS Modules: 修改config目录下 webpack.config.dev.js 和 webpack.config.prod.js 文件: CSS Modules 与 stylus 结合: create react app引入styl 阅读全文

posted @ 2018-07-31 10:20 cag2050 阅读(440) 评论(0) 推荐(0) 编辑

gaea-editor 项目使用
摘要:项目地址:https://github.com/ascoders/gaea editor 打开编辑器界面:运行 下载gaea editor项目,进行调试,注意点: gaea editor/packages 中,需要下载 gaea render:https://github.com/ascoders/ 阅读全文

posted @ 2018-07-14 12:16 cag2050 阅读(1565) 评论(0) 推荐(0) 编辑

create-react-app 搭建的项目中,引入 webpack-bundle-analyzer 打包分析
摘要:1. 安装 1. 在 config/webpack.config.prod.js 文件(推荐)或 config/webpack.config.dev.js 中,添加 1. 运行 (推荐,这样只在打包时,打开分析网页;这个地方具体命令名,可在 package.json 文件中 scripts 部分修改 阅读全文

posted @ 2018-06-14 18:07 cag2050 阅读(1909) 评论(0) 推荐(0) 编辑

react 子组件访问父组件的方法
摘要:1. 回调函数(推荐) 地址:https://ourcodeworld.com/articles/read/409/how to update parent state from child component in react 1. 获得父组件的实例(不推荐) 地址:https://stackov 阅读全文

posted @ 2018-05-21 17:58 cag2050 阅读(327) 评论(0) 推荐(0) 编辑

vue 和 react 组件间通信方法对比
摘要:vue 和 react 组件间通信方法对比: 通信路径 | vue的方法 | react的方法 | | 父组件 = 子组件 | props(推荐)、slot(推荐)、this.$refs、this.$children | props、this.refs 子组件 = 父组件 | 自定义事件($emit 阅读全文

posted @ 2018-05-18 10:12 cag2050 阅读(433) 评论(0) 推荐(0) 编辑

mobx-state-tree 知识点
摘要:中文教程:https://github.com/chenxiaochun/mobx state tree 比较好的介绍文章:https://tech.youzan.com/mobx_vs_redux/ mobx 和 mobx state tree 的区别: MobX 类库本身实现的是 Observa 阅读全文

posted @ 2018-05-17 20:12 cag2050 阅读(2369) 评论(0) 推荐(1) 编辑

mobx 知识点
摘要:antd+mobx 项目例子:https://github.com/cag2050/antd_mobx_demo 在 create react app 创建的项目中,使用 mobx:https://swizec.com/blog/mobx with create react app/swizec/7 阅读全文

posted @ 2018-05-14 00:42 cag2050 阅读(217) 评论(0) 推荐(0) 编辑

react-router v4 实现路由拦截的一种思路(待验证)
摘要:出处:https://segmentfault.com/q/1010000010905474 阅读全文

posted @ 2018-04-23 11:15 cag2050 阅读(431) 评论(0) 推荐(0) 编辑

create-react-app 搭建的项目中,使用 stylus
摘要:相关介绍文章: 1. react学习系列1 修改create react app配置支持stylus:https://www.jianshu.com/p/9cd7a0dff11f 1. 在react中使用stylus loader:https://z 950.github.io/2018/04/03 阅读全文

posted @ 2018-04-20 11:08 cag2050 阅读(1080) 评论(0) 推荐(0) 编辑

antd 知识点
摘要:表格实现:不管多少列,为列指定一个宽度,让表格在容器里可左右拖动 例子文件地址:https://github.com/cag2050/antd_mobx_demo/blob/master/src/components/tableDemo/TableDemo.js 上传组件的上传文件列表,无法通过程序 阅读全文

posted @ 2018-04-20 10:15 cag2050 阅读(169) 评论(0) 推荐(0) 编辑

webpack 图片没打包成功
摘要:webpack 图片打包: 1. 直接src引用的 ,webpack不会进行打包 2. 作为背景图片的,打包成功了 解决(react 写法): 1、import 方法(推荐): 2、require 方法: 本地文件 阅读全文

posted @ 2018-04-18 20:57 cag2050 阅读(337) 评论(0) 推荐(0) 编辑

React 使用 PropTypes 进行类型检查
摘要:注意: React.PropTypes 自 React v15.5 起已弃用。请使用 prop types 库代替。 defaultProps 用来确保 this.props.name 在父组件没有特别指定的情况下,有一个初始值。类型检查发生在 defaultProps 赋值之后,所以类型检查也会应 阅读全文

posted @ 2018-04-16 15:06 cag2050 阅读(700) 评论(0) 推荐(0) 编辑

导航

点击右上角即可分享
微信分享提示