doc: update docs/typescript.md
This commit is contained in:
parent
f80b5795bc
commit
d42cbc7d2c
@ -1495,6 +1495,18 @@ function makeBox<T>(value: T) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 保留一段时间字符串常量类型
|
||||||
|
|
||||||
|
```ts
|
||||||
|
type Color = "primary" | "secondary" | string;
|
||||||
|
```
|
||||||
|
|
||||||
|
修改成下面代码,有代码下拉提示
|
||||||
|
|
||||||
|
```ts
|
||||||
|
type Color = "primary" | "secondary" | (string & {});
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
不使用:
|
不使用:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user