摘要: TypeScript 的类型 8 种类型: number, string, boolean, 函数,array, any, void, object 这一节我们接触到了平常使用中会接触到的大部分的类型,下面我们挨个梳理一遍: number:数字类型,包含小数、其他进制的数字 let decimal: 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(31) 评论(0) 推荐(0)
摘要: TypeScript vs JavaScript TypeScript 是 “强类型” 版的 JavaScript,当我们在代码中定义变量 (包括普通变量、函数、组件、hook 等) 的时候,TypeScript 允许我们在定义的同时指定其类型,这样使用者在使用不当的时候就会被及时报错提醒: int 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(30) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(32) 评论(0) 推荐(0)
摘要: const SearchPannel = ({ users, param, setParam }) => { return ( <form> <div> <input type="text" value={param.name} onChange={evt => setParam({ ...para 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(38) 评论(0) 推荐(0)
摘要: module.exports = (req, res, next) => { console.log(req,res,next,"geyao") if (req.method "POST" && req.path "/login") { if (req.body.username "jack" && 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(27) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(21) 评论(0) 推荐(0)
摘要: const SearchList = ({ lists, users }) => { return ( <table> <thead> <tr> <th>项目</th> <th>负责人</th> </tr> </thead> <tbody> { lists.map(project => <tr> < 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(20) 评论(0) 推荐(0)
摘要: Mock数据配置 安装json-server yarn add json-server -D 创建本地Mock数据库在package.json中添加script脚本 "scripts": { "start": "react-scripts start", "build": "react-script 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(23) 评论(0) 推荐(0)
摘要: commitlint代码提交语句检查 安装依赖 官方网址 yarn add --dev @commitlint/{config-conventional,cli} 新建文件 echo "module.exports = {extends: ['@commitlint/config-conventio 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(31) 评论(0) 推荐(0)
摘要: 提交自动格式化 官网地址 安装依赖 npx mrm lint-staged 解决与eslint的冲突 yarn add eslint-config-prettier -D 配置package.json "husky": { "hooks": { "pre-commit": "lint-staged" 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(24) 评论(0) 推荐(0)