1、声明属性为
@property({ type: [RichText], visible: true, max:3 }) public bottomText:RichText[] = [];
或者:
@property([Item]) items: Item[] = [];
2、脚本挂在预置体上,打开预置体就爆错,如下:
xxxxxxxxxxxxxxxxx should be an array, but now it is null // 这行爆错黄色的。
[Window] Cannot read property ‘length’ of null // 这行爆错红色的。
3、为该属性复制,点击保存后,无效。再打开预置体编辑,爆错依旧。
4、装饰器要这样写:
@property({ type:Item, }) public items:Item[] = [];
这样写才不会爆错,
但是文档上,装饰器都是1的写法…… o(╯□╰)o