摘要: 概要 typescript在开发过程中广泛被应用,typescript的断言特性更是重中之重,今天和大家来讨论一下as const断言。 代码和讨论 我们首先来看一段代码, 如下: let a:string = "aaa"; const b = "aaa"; 以上代码除了const和let两个关键子 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(234) 评论(0) 推荐(0)
摘要: import { Button, Dropdown, Menu, Modal, Table, TableProps } from "antd"; interface ISearchListProps extends TableProps<Project> { users: User[]; } 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(51) 评论(0) 推荐(0)
摘要: 第一种方式 第二种 3接口管理工具 4本地node服务器 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(20) 评论(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 前端导师歌谣 阅读(24) 评论(0) 推荐(0)
摘要: prettier格式化插件 安装插件 安装依赖 yarn add --dev --exact prettier echo {}> .prettierrc.json 添加.prettierignore # Ignore artifacts: build coverage 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(25) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(24) 评论(0) 推荐(0)
摘要: // 1.接口 // interface ITest { // name: string // } // interface ITest { // age: number // } // class Person implements ITest { // name: string = "文咏珊" 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(27) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(19) 评论(0) 推荐(0)
摘要: 该软件包包括适用于各种浏览器的 polyfill。项目使用的最低要求和常用语言功能。 用法 首先,使用 Yarn 或 npm 安装包: npm install react-app-polyfill 或者 yarn add react-app-polyfill 支持 Internet Explorer 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(33) 评论(0) 推荐(0)
摘要: 创建项目 用脚手架创建项目 npx create-react-app jira --template typescript 在tsconfig.json中配置baseUrl "baseUrl": "./src", 阅读全文
posted @ 2022-10-07 18:45 前端导师歌谣 阅读(32) 评论(0) 推荐(0)