随笔分类 -  前端jira-hook学习笔记

前端jira-hook学习笔记
摘要:创建项目 用脚手架创建项目 npx create-react-app jira --template typescript 在tsconfig.json中配置baseUrl "baseUrl": "./src", 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(20) 评论(0) 推荐(0) 编辑
摘要:该软件包包括适用于各种浏览器的 polyfill。项目使用的最低要求和常用语言功能。 用法 首先,使用 Yarn 或 npm 安装包: npm install react-app-polyfill 或者 yarn add react-app-polyfill 支持 Internet Explorer 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(21) 评论(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 前端导师歌谣 阅读(18) 评论(0) 推荐(0) 编辑
摘要:commitlint代码提交语句检查 安装依赖 官方网址 yarn add --dev @commitlint/{config-conventional,cli} 新建文件 echo "module.exports = {extends: ['@commitlint/config-conventio 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(24) 评论(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 前端导师歌谣 阅读(18) 评论(0) 推荐(0) 编辑
摘要:prettier格式化插件 安装插件 安装依赖 yarn add --dev --exact prettier echo {}> .prettierrc.json 添加.prettierignore # Ignore artifacts: build coverage 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(18) 评论(0) 推荐(0) 编辑
摘要:啥时候需要声明类型 理论上来说在我们声明任何变量的时候都需要声明类型(包括普通变量、函数、组件、hook 等等),声明 函数、组件、hook 等需要声明参数 和 返回值的类型。 但是在很多情况下,TS 可以帮我们自动推断,我们就不用声明了,比如: // 这里虽然没有显式声明,但是ts自动推断这是个n 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(25) 评论(0) 推荐(0) 编辑
摘要:TypeScript 的类型 8 种类型: number, string, boolean, 函数,array, any, void, object 这一节我们接触到了平常使用中会接触到的大部分的类型,下面我们挨个梳理一遍: number:数字类型,包含小数、其他进制的数字 let decimal: 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(25) 评论(0) 推荐(0) 编辑
摘要:TypeScript vs JavaScript TypeScript 是 “强类型” 版的 JavaScript,当我们在代码中定义变量 (包括普通变量、函数、组件、hook 等) 的时候,TypeScript 允许我们在定义的同时指定其类型,这样使用者在使用不当的时候就会被及时报错提醒: int 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(17) 评论(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 前端导师歌谣 阅读(31) 评论(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 前端导师歌谣 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(16) 评论(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 前端导师歌谣 阅读(15) 评论(0) 推荐(0) 编辑
摘要:概要 typescript在开发过程中广泛被应用,typescript的断言特性更是重中之重,今天和大家来讨论一下as const断言。 代码和讨论 我们首先来看一段代码, 如下: let a:string = "aaa"; const b = "aaa"; 以上代码除了const和let两个关键子 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(208) 评论(0) 推荐(0) 编辑
摘要:import { Button, Dropdown, Menu, Modal, Table, TableProps } from "antd"; interface ISearchListProps extends TableProps<Project> { users: User[]; } 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(40) 评论(0) 推荐(0) 编辑
摘要:第一种方式 第二种 3接口管理工具 4本地node服务器 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(12) 评论(0) 推荐(0) 编辑
摘要:解决相对路径问题 ts.config.json "baseUrl": "./src", prettier yarn add --dev --exact prettier 自动格式化 npx mrm lint -staged "lint-staged": { "*.{js,css,md,ts,tsx} 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(17) 评论(0) 推荐(0) 编辑
摘要:npx create xxx 项目名 依赖按照 yarn start 进行项目运行 yarn start 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(25) 评论(0) 推荐(0) 编辑
摘要:useSearchParams 顾名思义,可以直接获取url中的query参数,而不需要引入外部库来解析路径中的query参数 import { useSearchParams} from 'react-router-dom'; // 比如 url是 /demo?name=1 function De 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(24) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示