oeyoews / neotw-tiddlers

由Tiddlywiki 记录的一些闪念笔记,主题笔记,词条笔记,项目笔记. 核心就是日记
https://tiddlywiki-starter-kit.vercel.app
Other
0 stars 1 forks source link

ts record usage #52

Closed oeyoews closed 7 months ago

oeyoews commented 7 months ago

在TypeScript中,record 通常是指用于描述具有动态属性的对象的数据结构。你可以使用Record类型来定义这样的对象。例如:

type MyRecord = Record<string, number>;

const myObject: MyRecord = {
  key1: 123,
  key2: 456,
  // 可以动态添加更多的属性
};

const valueForKey1: number = myObject.key1;  // 访问属性

这里的Record<string, number>表示一个具有字符串键和对应数字值的对象类型。

oeyoews commented 7 months ago

这条issue会引起gfm插件报错