(function(){ Vue.component('team-info',{ template: '
\
\
\ 团队名称:\ {{team.name}}\
\
\ 所在社区:\ {{team.hospitalName}}\
\
\ 团队长:\ {{team.leaderName}}\
\
\ 团队成员({{memberLength}}人):\

\ {{index==0? "": " 、"}}{{member.name}}\

\
\
', props:['teamId'], data: function(){ return { team: {}, members: [], memberLength: 0 } }, mounted: function(){ console.log(this.teamId); var vm = this; getTeamInfo(vm); } }); function getTeamInfo(vm){ var params = { teamId: vm.teamId }; statisticAPI.getTeamInfo(params).then(function(res){ if(res.status == 200){ vm.team = res.data.team; vm.members = res.data.members; vm.memberLength = res.data.members.length; }else{ console.log(res.msg); } }) } })()