ES6 Decorator 裝飾器

Decorator 裝飾器 簡介 裝飾器(Decorator)是一種與類(class)相關的語法,用來修改類、類方法和類屬性。 裝飾器是一種函數,寫成@ + 函數名。它能夠放在類、類方法和類屬性的定義前面。 @frozen class Foo { @configurable(false) @enumerable(true) method() {} @throttle(500)
相關文章
相關標籤/搜索