taro mobx问题

在store里设置变量wordArr: [{},{},{},{},{}],
组件里 wordArr.slice()需要加slice()这样在组件里更新了wordArr里的内容后,render上才会更新变动的数据,slice()相当于一次浅拷贝(一级拷贝,再深入就不行了)

            return item.name && {item.name}
        })```

如果在store里设置了 counter:{count:0}
那么在使用的时候,
//错误
const { counterStore: { counter } } = this.props  
return (
  {counter.count}
)
//正确
const { counterStore: { counter:{count} } } = this.props  
return (
  {count}
)

你可能感兴趣的:(taro mobx问题)