上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 36 下一页
摘要: const value = { ...values, birthday: values['birthday'].format('YYYY-MM-DD'), };//时间戳转字符串 moment(record.birthday, 'YYYY-MM-DD')//字符串转时间戳 # moment.js # 阅读全文
posted @ 2022-06-24 19:46 SimoonJia 阅读(16702) 评论(0) 推荐(1)
摘要: state: { // Reducer test: 'Dva 数据流:dashboard/test', data: [], num: 1, list: ['好好学习天天向上', 'good good study, day day up'], tableDate: [ { id: 1, name: ' 阅读全文
posted @ 2022-06-24 09:34 SimoonJia 阅读(46) 评论(0) 推荐(0)
摘要: 1. 组件 render 渲染了一个对象, 当 state 已确定更新但视图未更新 2. 组件 render 渲染了一个列表, 当 state 改变视图更新异常 3. A 和 B 子组件共用一个父组件 state, 此时点击子组件 A 按钮更新了父组件 state, 但是子组件 B 视图不更新 4. 阅读全文
posted @ 2022-06-23 14:18 SimoonJia 阅读(13453) 评论(0) 推荐(0)
摘要: const newList = list.slice(); 不要用等号赋值 (一些引用类型直接复制不会引起页面的重新渲染,所以尽可能使用数组方法完成业务需求) 原因: 对象数组是引用方式 , 对于 react 来说它的值都是地址 (涉及到 tree diff),因为没有被重新赋值 (地址没有改变), 阅读全文
posted @ 2022-06-23 14:15 SimoonJia 阅读(48) 评论(0) 推荐(0)
摘要: 1、setState() 2、props发生变化 3、forceUpdate() 阅读全文
posted @ 2022-06-23 14:14 SimoonJia 阅读(1216) 评论(0) 推荐(0)
摘要: <Input style={{ marginTop: '10px', marginRight: '10px', width: '200px' }} onChange={changeInputValue} /> const changeInputValue = (e) => { //e:改变的值都可以 阅读全文
posted @ 2022-06-23 10:39 SimoonJia 阅读(739) 评论(0) 推荐(0)
摘要: 报错原因 在新版本的npm中,默认情况下,npm install遇到冲突的peerDependencies时将失败。 解决办法 使用--force或--legacy-peer-deps可解决这种情况。 --force 会无视冲突,并强制获取远端npm库资源,当有资源冲突时覆盖掉原先的版本。--leg 阅读全文
posted @ 2022-06-22 17:38 SimoonJia 阅读(1160) 评论(0) 推荐(0)
摘要: 例如 npm i nrm -g 报 Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/nrm' 在命令前加上sudo即可 如: sudo npm i nrm -g 阅读全文
posted @ 2022-06-22 16:57 SimoonJia 阅读(92) 评论(0) 推荐(0)
摘要: TodoList.js componentDidMount(){ store.subscribe(this.storeChange) //订阅 axios.get('https://........').then((res)=>{ const data=res.data const action=g 阅读全文
posted @ 2022-06-21 23:52 SimoonJia 阅读(104) 评论(0) 推荐(0)
摘要: 删除this,用props作为参数代替this.props 性能比类组件性能优秀 JSX语法必须引入React TodoListUI.js import React from 'react' import {Input,Button,List} from 'antd' const TodoListU 阅读全文
posted @ 2022-06-21 23:21 SimoonJia 阅读(99) 评论(0) 推荐(0)
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 36 下一页