Created
February 6, 2021 03:54
-
-
Save diaolizhi/e7308c42895651009dc83e7f7b4fff72 to your computer and use it in GitHub Desktop.
jsx element ui image javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
type: 'common', label: '反馈图片', formatter: (row) => { | |
if (!row.images) { | |
return <div style='color: #999;'>未上传图片</div> | |
} | |
const res = [] | |
for (let i = 0; i < row.images.length; i++) { | |
const imageList = row.images.slice(i, row.images.length).concat(row.images.slice(0, i)) | |
res.push(<el-image style='width: 220px; display: inline-block; margin-bottom: 10px; margin-right: 10px' src={row.images[i]} | |
preview-src-list={imageList} | |
object-fit='fill'/>) | |
} | |
return ( | |
<div style='width: 700px;'> | |
{ res } | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment