上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 37 下一页
摘要: 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 阅读(121) 评论(0) 推荐(0)
摘要: npm install --save redux react-redux //安装react-redux和redux一般情况下安装redux即可,react-redux用法暂不明确 阅读全文
posted @ 2022-06-19 00:56 SimoonJia 阅读(366) 评论(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 阅读(2399) 评论(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 阅读(622) 评论(0) 推荐(0)
摘要: 找括号(括号匹配) Bracket Pair Colorizer ctrl+, 配置启用括号连线着色 自动生成注释插件 koroFileHeader ⭐⭐⭐一个插件迅速提升代码质量JavaScript Booster (js代码优化) 例如把if-else提示用三元运算符代替 多项目如何管理 Pro 阅读全文
posted @ 2022-06-14 06:56 SimoonJia 阅读(195) 评论(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 阅读(75) 评论(0) 推荐(0)
摘要: 1.设置规则 <Route path="/list/:id" component={List}/> {/* 1.规则 */} 2.传值(或在地址栏自己设置) <li><Link to="/list/123">列表</Link></li> 3.接收值 import React, { Component 阅读全文
posted @ 2022-06-13 03:12 SimoonJia 阅读(103) 评论(0) 推荐(0)
摘要: <Route path="/" exact component={Index}/> <Route path="/list/" component={List}/> /: 加exact 地址栏 /***匹配不到/对应的component 不加exact /***能匹配到 /list/: 加exact 阅读全文
posted @ 2022-06-13 02:19 SimoonJia 阅读(102) 评论(0) 推荐(0)
摘要: ’男‘ 数据类型为char “男” 数据类型为String 阅读全文
posted @ 2022-05-25 09:54 SimoonJia 阅读(6182) 评论(0) 推荐(0)
摘要: function Index(){ useEffect(()=>{ console.log('userEffect=>来了老弟') return ()=>{ //解绑副作用,但是只要状态变化,就会触发解绑 console.log('老弟走了啊?Index') } },[])//只有数组里的参数状态改 阅读全文
posted @ 2022-05-18 12:37 SimoonJia 阅读(736) 评论(0) 推荐(0)
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 37 下一页