Skip to content

Commit f8c2ffa

Browse files
committed
feat: update articles
1 parent e3a313a commit f8c2ffa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎JavaScript/TypeScript/类型使用/Decorator.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Decorator | 装饰器
22

3-
TypeScript 内建支持装饰器语法,需要我们在编译配置中开启装饰器参数:
3+
Typescript 中的装饰器与类相关,分别可以修饰类的实例函数和静态函数、类本身、类的属性、类中函数的参数以及类的 set/get 存取器。TypeScript 内建支持装饰器语法,需要我们在编译配置中开启装饰器参数:
44

55
```json
66
{
@@ -12,6 +12,8 @@ TypeScript 内建支持装饰器语法,需要我们在编译配置中开启装
1212
}
1313
```
1414

15+
# 类方法的装饰器
16+
1517
装饰器提供了声明式的语法来修改类的结构或者属性声明,以简单的日志装饰器为例:
1618

1719
```ts
@@ -67,3 +69,5 @@ export class Entity {
6769
}
6870
}
6971
```
72+
73+
# 元数据操作

0 commit comments

Comments
 (0)