
React
React
普通网友
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
react(85)--error:Error creating bean with name ‘onlineStudyController‘:
Error creating bean with name 'onlineStudyController': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)"接口定义了同样的值原创 2021-07-30 18:29:06 · 175 阅读 · 0 评论 -
前端学习(3248):react的生命周期getSnapBeforeUpdate举例
原创 2021-07-28 21:43:29 · 149 阅读 · 0 评论 -
前端学习(3251):dom的diff算法2
原创 2021-07-27 08:50:39 · 117 阅读 · 0 评论 -
前端学习(3252):react脚手架
原创 2021-07-27 08:50:20 · 112 阅读 · 3 评论 -
react学习(72)--row上面加样式
<Row> <Col> <Button style={{ marginTop: '24px', marginBottom: '24px', float: 'right', marginRight: '24px', ...原创 2021-07-27 08:49:49 · 552 阅读 · 3 评论 -
react学习(71)--render使用
title: '品牌资质有效期', dataIndex: 'certificationStartDate', render: (text, row) => { return ( <span> {moment(row.certificationStartDate).format('YYYY-MM-DD')}- {moment(row.certificatio..原创 2021-07-27 08:49:29 · 312 阅读 · 0 评论 -
react学习(70)--拼接方式
const tabs = [{ key: '', value: '全部' }, ...MERCHANTLISTSTARTUS];原创 2021-07-27 08:49:06 · 337 阅读 · 0 评论 -
react学习(69)--置空操作
//重置按钮 handleReset = () => { this.props.form.setFieldsValue({ merchantCode: '', goodsCode: '', }); };原创 2021-07-27 08:48:27 · 331 阅读 · 0 评论 -
react学习(68)--ant design inputNumber
<InputNumber min={0} style={{ width: 100 }} onPressEnter={this.handleSearch} />原创 2021-07-27 08:48:06 · 339 阅读 · 0 评论 -
react学习(67)--git 屏蔽文件不被追踪
```bash# 屏蔽文件不被 git 追踪git update-index --assume-unchanged [FILE]# 如果要还原的话,使用命令:git update-index --no-assume-unchanged [FILE]```原创 2021-07-27 08:45:31 · 156 阅读 · 0 评论 -
react学习(62)--注意数据格式返回
原创 2021-07-27 08:43:00 · 155 阅读 · 0 评论 -
react学习(61)--js contact
定义和用法concat() 方法用于连接两个或多个数组。该方法不会改变现有的数组,而仅仅会返回被连接数组的一个副本。原创 2021-07-27 08:40:54 · 1434 阅读 · 0 评论 -
react学习(60)--ant design中getFieldDecorator
<From> <FormItem> //JS代码书写时需要用 { } 包裹起来,不能直接写在代码块中 { getFieldDecorator('userName',{ initialValue:'Jack', rules:[ { required:true, messa.原创 2021-07-27 08:40:26 · 758 阅读 · 0 评论 -
react学习(61)-antdesign 中getFieldValue
handleSubmit = e => { const { dispatch } = this.props; e.preventDefault(); var date_juban = this.props.form.getFieldValue('date_juban'); this.state.open_time_start = date_juban[0]; this.state.open_time_end = date_juban[1]; if ...原创 2021-07-27 08:38:55 · 1392 阅读 · 0 评论 -
react学习(59)--this.props语法糖
{...this.props}是props所提供的语法糖,可以将父组件的所有属性复制给子组件原创 2021-07-20 20:19:26 · 278 阅读 · 3 评论 -
react学习(58)--this.props进行父子传值
原创 2021-07-20 20:19:05 · 191 阅读 · 3 评论 -
react学习(57)--map赋值
<Radio.Group> {linksList?.map((item) => ( <Radio key={item.key} value={item.key}> {item.value} </Radio> ))} </Radio.Group>原创 2021-07-20 20:18:45 · 399 阅读 · 1 评论 -
react学习(56)--常见HTTP错误
200: '服务器成功返回请求的数据。', 201: '新建或修改数据成功。', 202: '一个请求已经进入后台排队(异步任务)。', 204: '删除数据成功。', 400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。', 401: '用户没有权限(令牌、用户名、密码错误)', 403: '用户得到授权,但是访问是被禁止的。', 404: '发出的请求针对的是不存在的记录,服务器没有进行操作。', 406: '请求的格式不可得。', 410: '请...原创 2021-07-20 20:18:25 · 234 阅读 · 0 评论 -
react学习(55)--ant design spin
import { Spin, Switch, Alert } from 'antd';class Card extends React.Component { state = { loading: false }; toggle = value => { this.setState({ loading: value }); }; render() { return ( <div> <Spin spinning={t.原创 2021-07-16 20:46:22 · 495 阅读 · 0 评论 -
react学习(51)--避免死循环
()=>{this.handleSubmit(true)原创 2021-07-16 20:46:01 · 263 阅读 · 0 评论 -
react学习(53)--传参payload
this.props.dispatch({ type: 'startpage/getStartPageByCode', payload: { code: this.props.location.query.code }, callback: (res) => { this.setState({ popupByCodeDetail: res.data, }); }, });原创 2021-07-16 20:44:48 · 1628 阅读 · 0 评论 -
react学习(52)--字段太长
### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(64) ### The error may exist in com/yoao/cloud/advertisement/persistence/mapper/StartPageDao.java (best guess) ### The error may involve原创 2021-07-16 20:44:20 · 446 阅读 · 0 评论 -
react学习(50)--解决异步执行顺序问题
this.props.dispatch({ type: 'activity/addActivityPopup', payload: params, callback: (res) => { if (res.returnCode === 0) { message.success('新增成功'); if (flag === true) { ...原创 2021-07-16 20:43:59 · 751 阅读 · 0 评论 -
react学习(49)--参数判定
<div style={{ textAlign: 'center' }}> <Button type="primary" onClick={this.handleSubmit(false)} style={{ marginRight: '10px' }}> 保存 </Button> <Button oncllck={this.handleCancel} style..原创 2021-07-16 20:43:40 · 196 阅读 · 0 评论 -
react学习(47)----react中initialValue和value不能一起定义
<Row gutter={12}> <Col span={12}> <Form.Item label="活动开始时间"> {getFieldDecorator('startTimeLong', { initialValue: popupByIdDetail.startTimeLong, ...原创 2021-07-16 20:41:45 · 420 阅读 · 0 评论 -
react学习(46)----react渲染组件
const element = <div />;不过,React 元素也可以是用户自定义的组件:const element = <Welcome name="Sara" />;当 React 元素为用户自定义组件时,它会将 JSX 所接收的属性(attributes)以及子组件(children)转换为单个对象传递给组件,这个对象被称之为 “props”。例如,这段代码会在页面上渲染 “Hello, Sara”:function Welcome(props).原创 2021-07-16 20:41:07 · 270 阅读 · 0 评论 -
react学习(45)----react组件
定义组件最简单的方式就是编写 JavaScript 函数:function Welcome(props) { return <h1>Hello, {props.name}</h1>;}该函数是一个有效的 React 组件,因为它接收唯一带有数据的 “props”(代表属性)对象与并返回一个 React 元素。这类组件被称为“函数组件”,因为它本质上就是 JavaScript 函数。你同时还可以使用 ES6 的 class 来定义组件:class Welcom原创 2021-07-16 20:40:47 · 110 阅读 · 0 评论 -
react学习(44)----只更新它需要更新的部分
原创 2021-07-16 20:40:24 · 267 阅读 · 0 评论 -
react学习(43)----react中将一个元素渲染为 DOM
假设你的 HTML 文件某处有一个 <div>:<div id="root"></div>我们将其称为“根” DOM 节点,因为该节点内的所有内容都将由 React DOM 管理。仅使用 React 构建的应用通常只有单一的根 DOM 节点。如果你在将 React 集成进一个已有应用,那么你可以在应用中包含任意多的独立根 DOM 节点。想要将一个 React 元素渲染到根 DOM 节点中,只需把它们一起传入 ReactDOM.render():原创 2021-07-16 20:39:58 · 355 阅读 · 0 评论 -
react学习(42)----react中的jsx表达对象
JSX 表示对象Babel 会把 JSX 转译成一个名为 React.createElement() 函数调用。以下两种示例代码完全等效:const element = ( <h1 className="greeting"> Hello, world! </h1>);const element = React.createElement( 'h1', {className: 'greeting'}, 'Hello, world!')原创 2021-07-16 20:39:31 · 195 阅读 · 0 评论 -
react学习(41)----react中的jsx简介
JSX 特定属性你可以通过使用引号,来将属性值指定为字符串字面量:const element = <div tabIndex="0"></div>;也可以使用大括号,来在属性值中插入一个 JavaScript 表达式:const element = <img src={user.avatarUrl}></img>;...原创 2021-07-16 20:38:49 · 128 阅读 · 0 评论 -
react学习(40)----react中的jsx简介
const name = 'Josh Perez';const element = <h1>Hello, {name}</h1>;ReactDOM.render( element, document.getElementById('root'));jsx语法是个表达式 可以直接声明变量原创 2021-07-16 20:38:00 · 86 阅读 · 0 评论 -
react学习(39)----react中的Hello World
ReactDOM.render( <h1>Hello, world!</h1>, document.getElementById('root'));它将在页面上展示一个 “Hello, world!” 的标题。原创 2021-07-16 20:31:56 · 149 阅读 · 0 评论 -
react学习(38)----react是什么
什么是组件?官方定义:将一些简短、独立的代码片段组合成复杂的 UI 界面,这些代码片段被称作“组件”。解读:我们可以理解为能够组成一个UI界面的每一个独立的代码片段,例如表单的代码集合,轮播图的代码集合,讲这些能够构成特定功能的代码集合我们称之为组件。React.component子类我们以下面这段代码为例,进行详细的分析:class ShoppingList extends React.Component { render() { return (原创 2021-07-16 20:31:24 · 110 阅读 · 0 评论 -
react学习(22)---需要export
import React, { Component } from 'react';class Edit extends Component { render() { return <div>1111</div>; }}export default Edit;原创 2021-07-15 22:04:17 · 108 阅读 · 0 评论 -
react学习(37)----获取子组件得实例
onRef={(ref) => { this.uploadImg = ref; }}原创 2021-07-15 22:16:50 · 299 阅读 · 1 评论 -
react学习(35)----getFieldDecorator will override value
我在自定义组件中定义了value值,getFieldDecorator会覆盖我们定义的值,需要添加默认值可以使用在getFieldDecorator的时候,设置initialValue,删除在自定义组件中定义的value就可以了!原创 2021-07-15 22:14:21 · 280 阅读 · 0 评论 -
react学习(34)----radio回显
<div style={{ overflow: 'hidden' }}> <Radio.Group style={{ float: 'left', marginTop: 5 }} onChange={this.handleOpenScopeType} value={openScopeType} ...原创 2021-07-15 22:13:30 · 506 阅读 · 0 评论 -
react学习(32)----onref
// 父组件import React from 'react'import Son from './son'import { Button } from 'antd'class Father extends React.Component { child: any constructor(props) { super(props) } sonRef = (ref) => { this.child = ref // 在这里拿到子组件的实例 } clea.原创 2021-07-15 22:12:02 · 212 阅读 · 0 评论 -
react学习(31)----react父传子
import React from 'react'import Son from './son'class Father extends React.Component { constructor(props) { super(props) } state = { info: '父组件', } handleChange = (e) => { this.setState({ info: e.target.value, }) } .原创 2021-07-15 22:11:08 · 173 阅读 · 0 评论