亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在材料表單元格中添加圖像?

如何在材料表單元格中添加圖像?

蠱毒傳說 2023-04-27 10:15:39
我在詳細表中添加了圖像(可能不正確)?,F在我不會編輯數據并且圖像字段有問題(沒有圖像一切正常)。 在此處輸入圖像描述           columns={[{ title: 'ID', field: 'id' },                     { title: '', field: 'img'},                     { title: 'Title', field: 'title' },                     { title: 'Price', field: 'price' },                     { title: 'Quantity', field: 'quantity' },                     { title: 'Subtotal', field: 'subtotal' },                     { title: 'Description', field: 'description', hidden: true}, ]}          data={rowData.items.map((item)=>                  ({id: item.id, title:item.title,                     price:item.price,                    quantity:item.quantity,                    subtotal:item.price*item.quantity,                     description:item.description,                    img:<img src={item.img} alt="" border="3" height="100" width="100" />                                                 }))}        editable={{                  onRowDelete: oldData =>                       new Promise((resolve, reject) => {                           console.log(oldData);                              setTimeout(() => {                               const index = oldData.tableData.id;                               rowData.items.splice(index, 1);                                                                                         removeItemFromOrder(rowData.orderNumber,oldData);                               resolve()                                                         }, 1000)                                                     }),                                             }}
查看完整描述

1 回答

?
Smart貓小萌

TA貢獻1911條經驗 獲得超7個贊

嘗試這個:


 columns={[{ title: 'ID', field: 'id' },

                     { title: '', field: 'img', render: item => <img src={item.img} alt="" border="3" height="100" width="100" />},

                     { title: 'Title', field: 'title' },

                     { title: 'Price', field: 'price' },

                     { title: 'Quantity', field: 'quantity' },

                     { title: 'Subtotal', field: 'subtotal', render: (item) => item.price*item.quantity},

                     { title: 'Description', field: 'description', hidden: true}, ]}

          data={rowData.items}


查看完整回答
反對 回復 2023-04-27
  • 1 回答
  • 0 關注
  • 136 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號