Template.measurementTable.onCreated(() => { const instance = Template.instance(); const patientName=instance.data.studies[0].patientName; xnatInstance.get(`http://10.2.10.106:5199/mri/predict?pid=${patientName}`).then((respose)=> { console.log(respose.data.msg); instance.datas=respose.data.msg; }); instance.datas='GX'; });Template.measurementTable.helpers({ datas() { const instance = Template.instance(); if (instance.datas!=='GX') { return instance.datas; } return instance.datas; } });
现在返回的是GX,想要返回的内容是请求结果,但是结果再回调里,按照执行顺序会返回GX,应该怎么弄?用async和await应该怎么写?
相关分类