随笔分类 - react
摘要:contructor 开始: getDefaultProps-->getInitialState-->componentWillMount-->render-->compononentDidMount props发生变化: componentWillReciveProps-->shouldCompo
阅读全文
摘要:一个组件的显示形态由数据状态state和外部参数props所决定。 state和props 不同之处,state是可以被改变的,使用setState 和useState中定义的setxxx改变值,都是异步的。 state主要作用是: 用于组件保存、控制以及修改自己的状态; 它只能在contructo
阅读全文
摘要:react的核心思想是组件化思想,页面被分割成一个个独立可复用的组件。 组件化从概念上看就是一个函数,可以接受参数作为输入值,这个参数就是props,props可以理解成从外部传入组件内部的数据。 由于react是单向数据流,所以props基本上也就是从父级组件向子组件传递的数据。
阅读全文
摘要:render 方法 返回一个根节点的jsx 这个jsx是最后转义后html渲染到html,就是js写的html.
阅读全文
摘要:注意Breadcrumb如果是Dropdown的上一份元素或下一个元素,会影响Dropdown下拉菜单的出现时方向。 基本属性: 参数说明类型默认值版本 disabled 菜单是否禁用 boolean - getPopupContainer 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚
阅读全文
摘要:Breadcrumb.Item的属性: 参数参数类型默认值版本 href 链接的目的地 string - 3.17.0 overlay 下拉菜单的内容 Menu | () => Menu - 3.17.0 onClick 单击事件 (e:MouseEvent)=>void - 3.17.0 使用:
阅读全文
摘要:表单 基本结构: import React, { Component } from "react"; class FormDemo extends Component { constructor(props) { super(props); this.state = { //... }; } ren
阅读全文
摘要:成员说明类型默认值版本 offsetBottom 距离窗口底部达到指定偏移量后触发 number offsetTop 距离窗口顶部达到指定偏移量后触发 number target 设置 Affix 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 () => HTMLElement (
阅读全文
摘要:formatResult: (res) => { if (res.code != 200) { return } return { list: res.data.records || [], total: res.data.total || 0 } } //需要返回格式{list: 返回值,tota
阅读全文
摘要:useEffect(() => { console.log('每次首次/重新进入时执行') return () => { console.log('每次离开时执行') } }, [])
阅读全文

浙公网安备 33010602011771号