We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 07830d2 commit fec1912Copy full SHA for fec1912
1 file changed
docs/decorator.md
@@ -357,14 +357,16 @@ class C {
357
如果方法装饰器返回一个新的函数,就会替代所装饰的原始函数。
358
359
```typescript
360
-function replaceMethod() {
361
- return function () {
+function replaceMethod(value:any, context:ClassMethodDecoratorContext) {
+ return function (this:Person) {
362
return `How are you, ${this.name}?`;
363
}
364
365
366
class Person {
367
- constructor(name) {
+ name: string;
368
+
369
+ constructor(name:string) {
370
this.name = name;
371
372
0 commit comments