1.5.1带的TypeScript项目使用VS打开项目后提示错误

其中cc.Label下面有红色的错误提示,VS右下角显示的TypeScript版本2.4.1

file: ‘file:///d%3A/CocosCreator/Project/TestTypeScript/assets/Script/SuperClass.ts’
severity: ‘错误’
message: ‘Type ‘typeof Label’ has no properties in common with type ‘{ type?: any; url?: typeof RawAsset; visible?: boolean | (() => boolean); displayName?: string; t…’.’
at: ‘7,15’
source: ‘ts’

估计是不是property装饰器的写法不对?
试试这样:

@property({
     default : null,
     type : cc.Label
})
1赞

多谢,这样的确可以

和空格没关系。

不行呀,怎么解决的求解?

官方说的1.6修复这个问题

没太明白你说的什么意思。
如果你用的是1.5.x,那么就在property装饰器中完整的写全需要的配置default、type等;
如果你升级到了1.6.x,那应该是已经修复了这个问题(我本人还没升级到1.6.x,所以不清楚1.6的那个版本修复的)

完整的可以,谢谢了