Skip to Content
开发实践TypeScript 基础

TypeScript 基础

这篇笔记位于「开发实践」目录下,用于验证多级导航。

定义类型

note.ts
type Note = { title: string; published: boolean; }; const note: Note = { title: "开始记录", published: true, };

可选属性

可选属性使用 ? 标记,例如 description?: string。

常用类型

类型示例说明
string"Minki"文本
booleantrue布尔值
string[]["Next.js", "MDX"]字符串数组

本地检查

pnpm exec tsc --noEmit pnpm build

相关笔记

返回 开始记录 或 技术笔记首页。

Last updated on