【BUG ?】3.3 声明数组属性,编辑器里爆错

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

我还是报错

确实,两种写法,在3.4.2上都报错。

同事测试过,目前 3.4.2 和 3.5 没有报错了。

该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。