(function(){ Vue.component('device-section', { template: '
\

健康设备

\
\ \
\
\
\ \
\
暂无相关设备数据
\
\
', props: ['patient'], data: function() { return { deviceInfo: [], hasData: true } }, mounted: function() { var vm = this; getDeviceInfo(vm); }, }); function getDeviceInfo(vm){ var params = { patient: vm.patient }; patientAPI.getDeviceInfo(params).then(function(res){ if(res.status == 200){ vm.deviceInfo = res.data; if(res.data.length > 0){ vm.hasData = true; }else{ vm.hasData = false; } }else{ console.log(res.msg); } }) } })()