上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 35 下一页
摘要: constructor(props){ super(props) this.state=store.getState() this.changeInputValue=this.changeInputValue.bind(this) this.storeChange=this.storeChange. 阅读全文
posted @ 2022-06-20 19:55 SimoonJia 阅读(214) 评论(0) 推荐(0)
摘要: TodoList.js import React, { Component } from 'react' import {Input,Button,List} from 'antd' import store from './store'; class TodoList extends Compon 阅读全文
posted @ 2022-06-19 02:56 SimoonJia 阅读(37) 评论(0) 推荐(0)
摘要: this的指向不对,需要用bind绑定this 例如 constructor(props){ super(props) this.state=store.getState() this.changeInputValue=this.changeInputValue.bind(this)//绑定 sto 阅读全文
posted @ 2022-06-19 02:47 SimoonJia 阅读(1395) 评论(0) 推荐(0)
摘要: 扩展商店 1.浏览器里安装redux-devtools 谷歌: edge: 2.在项目的入口文件里 找到 createStore函数调用的地方,给它加第二个参数 window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENS 阅读全文
posted @ 2022-06-19 01:40 SimoonJia 阅读(356) 评论(0) 推荐(0)
摘要: npm install --save redux react-redux //安装react-redux和redux "^4.2.0", 只装 redux也可 TodoList.js import React, { Component } from 'react' import {Input,But 阅读全文
posted @ 2022-06-19 01:28 SimoonJia 阅读(115) 评论(0) 推荐(0)
摘要: npm install --save redux react-redux //安装react-redux和redux一般情况下安装redux即可,react-redux用法暂不明确 阅读全文
posted @ 2022-06-19 00:56 SimoonJia 阅读(363) 评论(0) 推荐(0)
摘要: useNavigate() may be used only in the context of a <Router> component. //useNavigate()只能在<Router>组件的上下文中使用。 解决办法,将使用useNavigate或useHistory的组件和方法封装成一个新 阅读全文
posted @ 2022-06-14 09:22 SimoonJia 阅读(2393) 评论(0) 推荐(0)
摘要: import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; 使用 <Routers>包裹 来替代之前版本的<switch>且Route必须被包裹在Routes中 <Route path="/pd3" compo 阅读全文
posted @ 2022-06-14 09:01 SimoonJia 阅读(607) 评论(0) 推荐(0)
摘要: 找括号(括号匹配) Bracket Pair Colorizer ctrl+, 配置启用括号连线着色 自动生成注释插件 koroFileHeader ⭐⭐⭐一个插件迅速提升代码质量JavaScript Booster (js代码优化) 例如把if-else提示用三元运算符代替 多项目如何管理 Pro 阅读全文
posted @ 2022-06-14 06:56 SimoonJia 阅读(189) 评论(0) 推荐(0)
摘要: 前进后退不可使用 (独立页面相似意思) 普通式重定向 1.设置route <Route path="/home/" component={Home}/> 2.书写组件 import React, { Component } from 'react' class Home extends Compon 阅读全文
posted @ 2022-06-13 03:37 SimoonJia 阅读(74) 评论(0) 推荐(0)
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 35 下一页