收藏
回答

setData回调中报渲染错误?

var that = this;

this.setData({

addNum: addNum,

pageMessageList: pageMessageList

},()=>{

 var msgLength = that.data.pageMessageList.length;         

 if(msgLength && (msgLength >8 )){

        that.setScrollBottom();

 } 

})

setData回调中,if判断那儿报 渲染层错误,如果不写if,只写 that.setScrollBottom();则不报错。这是怎么回事啊?


回答关注问题邀请回答
收藏

2 个回答

  • 南方菜好吃
    南方菜好吃
    2020-10-10

    this.data.pageMessagelist

    2020-10-10
    有用
    回复
  • 订阅happiness
    订阅happiness
    2020-04-26
    this.setData({
      addNum,
      pageMessageList
    },() => {
     var msgLength = pageMessageList.length        
     if (msgLength > 8){
      this.setScrollBottom()
     } 
    })
    
    2020-04-26
    有用
    回复 4
登录 后发表内容
问题标签