组件的Ready函数中,log数据正常但是debug是空的?
发布于 5 年前 作者 jing42 2762 次浏览 来自 官方Issues
properties: {
  baseInfo: {
    type: Object,
    value: {
      chinese_name: '',
      english_name: '',
      first_name: '',
      last_name: '',
      gender: '',
      identification_id: '',
      birthday: '',
      marital: '',
      phone: '',
      private_email: '',
      hukou_address: '',
      country_id: '',
      address_street: '',
      address_street2: '',
      address_street3: '',
      address_zip: '',
      ssnid_region: '',
      ssnid_start_date: '',
      emergency_contact: '',
      emergency_phone: '',
      emergency_relationship: '',
    }
  }
},
lifetimes:{
  ready: function () {
    debugger;

      let fieldList = Object.keys(this.data.baseInfo).map(key => {
        return {
          ...this.data.baseInfo[key],
          icon: this.data.icon[this.data.baseInfo[key].icon],
          key: key
        }
      })
      this.setData({
        fieldList: fieldList
      });

    console.log('base-info is ready',this.data);
  }
}

使用debugger时,baseInfo是空的,后续的数组处理也没有数据,但是之后的console.log输出却是正常的。

有谁知道这是因为啥造成的么?

回到顶部