随笔分类 -  react

create-react-app
摘要:1.constructor():构造函数 执行时间:组件被加载前最先调用,并且仅调用一次 作用:定义状态机变量 注意:第一个语句必须是super(props),正确定义状态机代码如下 constructor(props) { super(props); this.state = { content: 阅读全文
posted @ 2018-09-26 16:23 一叶*秋 阅读(408) 评论(0) 推荐(0)
摘要:import React, { Component } from 'react';import logo from './logo.svg';import './App.css';import 'antd/dist/antd.css';// import DatePicker from 'antd/ 阅读全文
posted @ 2018-09-06 20:49 一叶*秋 阅读(208) 评论(0) 推荐(0)
摘要:1.安装npm install axios 2.在package.json下添加 阅读全文
posted @ 2018-09-06 20:32 一叶*秋 阅读(862) 评论(0) 推荐(0)
摘要:父组件 阅读全文
posted @ 2018-09-06 15:35 一叶*秋 阅读(42570) 评论(1) 推荐(1)
摘要:import React, {Component} from 'react'; export default class Parent extends Component { render() { return( <div> <Child onRef={this.onRef} /> <button 阅读全文
posted @ 2018-09-06 15:12 一叶*秋 阅读(7287) 评论(0) 推荐(0)
摘要:import React, { Component } from 'react';import { Button } from 'antd';import cookie from 'react-cookies'class Cookie extends Component { constructor( 阅读全文
posted @ 2018-09-06 14:41 一叶*秋 阅读(19918) 评论(0) 推荐(0)
摘要:import React, { Component } from 'react';import { BrowserRouter as Router, Route, Link, Switch, Redirect} from 'react-router-dom';import About from '. 阅读全文
posted @ 2018-09-06 14:39 一叶*秋 阅读(1655) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-09-06 14:35 一叶*秋 阅读(82) 评论(0) 推荐(0)
摘要:1.npm run eject 2.npm install mobx mobx-react --save 3.npm install --save-dev babel-plugin-transform-decorators-legacy 4.npm install babel-core babel- 阅读全文
posted @ 2018-09-04 12:51 一叶*秋 阅读(444) 评论(0) 推荐(0)

博客侧边栏公告广告位招租