render函數 for循環返回多個div

render:(h, params) => {
  let _this = this
  return h('div',{class:'analysisState clearfix'},[
      params.row.spreadCores.map(function (item,index) {
          return h('div',{
              class:'divCores clearfix',
          },[
            h('img',{
               attrs:{
                 src:item.headImageUrl
               },
             class:'spreadimg',
               }),
             h('div',{class:'divright'},[
                h('div',{
                      class:'spreadName',
                    },item.name),
                    h('div',{
                      class:'spreadCount',
                },'帶動轉發:'+item.forwardsCount)
             ])
          ])
      })
   ])

}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章