随笔分类 - React
摘要:将组件中所用数据和方法通过props传给子UI组件,子UI组件调用这些数据和方法完成页面渲染(业务逻辑层的构造函数不变) TodtListUI.js import React, { Component } from 'react' import {Input,Button,List} from 'a
阅读全文
摘要:export const getListAction=(data)=>({ type:GET_LIST, data }) const action=getListAction(data) 调用该方法,取到的是括号内部的值 所以该写法可看作()=>{return{}} 首先这里用的时ES6的箭头函数
阅读全文
摘要:报错的意思应该是因为必须在组件挂载后订阅 componentDidMount(){ // store.subscribe(this.storeChange) //订阅 }
阅读全文
摘要:import axios from "axios"; const baseUrl = "http:/123.57.50.179:8900"; const getRequest = (path, params) => { return axios.get(baseUrl + path, { param
阅读全文
摘要:import localStorage from "localStorage";//引入 localStorage.setItem("userInfo", JSON.stringify(res.data.data));//存 localStorage.setItem("user", res.data
阅读全文
摘要:constructor(props){ super(props) this.state=store.getState() this.changeInputValue=this.changeInputValue.bind(this) this.storeChange=this.storeChange.
阅读全文
摘要:this的指向不对,需要用bind绑定this 例如 constructor(props){ super(props) this.state=store.getState() this.changeInputValue=this.changeInputValue.bind(this)//绑定 sto
阅读全文
摘要:(查看自己使用的哪个npm源) npm config get registry 安装arm(管理npm源) npm i nrm -g 查看npm源 nrm ls 切换npm源 nrm use taobao(镜像源) 其他正常使用 npm i (加载配置)
阅读全文

浙公网安备 33010602011771号