编辑器面本中动态显隐藏属性项,该如何做,求大神指点~

如题,ccc1.6.1b2 使用typescript开发,目前的写法如下:
@property({default:false})
_repeat=false;
@property({displayName:“重复”})
get repeat () {
return this._repeat;
}
@property()
set repeat (value) {
this._repeat = value;
}
@property({default:0,type:cc.Float,displayName: ‘重复次数’,visible:()=>{return this.repeat}})
repeatCount=0;

目的就是想在勾选了重复选项以后,在可以显示重复需要设置的参数。
但是我这样写目前报错如下:

1赞

这里不要用箭头函数,要写成:
@property({default:0,type:cc.Float,displayName: ‘重复次数’,visible(){return this.repeat}})

多谢多谢~太感谢了