我有点迷失在 MobX 中的数组,
我正在尝试访问数组的值并对其进行处理,但它的行为非常奇怪。
例如 :
console.log('arr arr', this.props.arr) // ["test1, "test2", "test3"]
console.log('arr arr', Array.isArray(this.props.arr)) // true
console.log('arr arr', this.props.arr.length) // 0 (?!?)
所以我不能映射我的数组,我不能循环我的数组,它完全没用。
.slice
我看到了一些关于使用and处理这个问题的同一主题的问题.replace
,但这也无济于事。
如果你需要我,我可以添加其余的代码