Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
222 views
in Technique[技术] by (71.8m points)

js中装饰器的执行时机是什么时候?

最近看装饰器内容,有点不明白装饰器执行的时机。

image.png
ruanyifeng文章中提到装饰器是编译是执行的,那就是在普通代码之前执行,但我测试发现不一致

image.png

上面是我用ts写的代码,执行顺序是2、1、3。如果装饰器是编译阶段执行,那不应该是1、2、3的顺序吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
...