Paw*_*ski 10 javascript google-closure-compiler jsdoc
我有一个JavaScript类,它接受一个Object类型的参数和定义的属性集,当我注释它时,Closure Compiler很高兴:
@constructor
@param {{ subview:BaseView, el:(jQuery|Element), title:String }} options
var MyView = function(options){ }
我想使titlekey可选并将title值传递给我的类的某些实例,并在此键不存在时实现回退行为,因此我使用以下内容对我的类进行了注释:
@constructor
@param {{ subview:BaseView, el:(jQuery|Element), title:String= }} options
var MyView = function(options){ }
现在Closure Compiler正在抱怨:
WARNING - Bad type annotation. expected closing }
我已经为Closure Compiler检查了Annotating JavaScript,但是我没有看到描述这种用例的单行.
Mat*_*rog 16
@param {{ subview:BaseView, el:(jQuery|Element), title:(string|undefined) }} options
| 归档时间: | 
 | 
| 查看次数: | 3653 次 | 
| 最近记录: |