Pinkmani
Pinkmani
  • 发布:2020-09-21 11:42
  • 更新:2020-09-21 11:42
  • 阅读:1482

onLoad取不到data()中定义的数据

分类:uni-app
data() {  
            return {  
                ...  
                // 医院简介  
                hosDetail: {}  
                                ...  
            }  
        },  
        onLoad() {  
            this.getHosDetail();  
            console.log(this.hosDetail)  
        },  
methods: {  
            getHosDetail() {  
                reqHosDetail({  
                    id: 18,  
                    orgId: 103  
                }).then(res => {  
                    console.log(res);  
                    this.hosDetail = res.data.rows[0];  
                })  
            }  
        }

控制台输出结果:

2020-09-21 11:42 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复