mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 10:22:23 +00:00
docs(class): fix #906
This commit is contained in:
parent
93f9d7cc0c
commit
10338972d5
@ -681,7 +681,7 @@ Foo.prop // 1
|
||||
|
||||
上面的写法为`Foo`类定义了一个静态属性`prop`。
|
||||
|
||||
目前,只有这种写法可行,因为 ES6 明确规定,Class 内部只有静态方法,没有静态属性。现在有一个[提案](https://github.com/tc39/proposal-class-fields)提供了类的静态属性,写法是在实例属性法的前面,加上`static`关键字。
|
||||
目前,只有这种写法可行,因为 ES6 明确规定,Class 内部只有静态方法,没有静态属性。现在有一个[提案](https://github.com/tc39/proposal-class-fields)提供了类的静态属性,写法是在实例属性的前面,加上`static`关键字。
|
||||
|
||||
```javascript
|
||||
class MyClass {
|
||||
|
Loading…
x
Reference in New Issue
Block a user