問題
視覺
點(diǎn)擊圖片進(jìn)行預(yù)覽,但還能繼續(xù)選中其他的圖片進(jìn)行預(yù)覽,鼠標(biāo)放在表格上,那一行表格也會(huì)選中,如圖所示第一行的效果。
代碼文章來源:http://www.zghlxwxcb.cn/news/detail-647104.html
<el-table-column prop="id" label="ID" width="80" align="center" sortable/>
<el-table-column label="商品圖片" width="85px">
<template #default="scope">
<el-image
style="width: 60px;height: 60px;"
:src="scope.row.avatar"
:preview-src-list="[scope.row.avatar]"
hide-on-click-modal="true">
<template #error>
<div class="image-slot">
<el-icon><user /></el-icon>
</div>
</template>
</el-image>
</template>
</el-table-column>
<el-table-column prop="username" label="用戶名" width="130"/>
解決
官網(wǎng)文檔有這么一個(gè)屬性,官網(wǎng)是這個(gè)描述的Image屬性。
在<el-image>
中加入屬性preview-teleported="true"
即可。文章來源地址http://www.zghlxwxcb.cn/news/detail-647104.html<el-table-column label="商品圖片" width="85px"> <template #default="scope"> <el-image style="width: 60px; height: 60px;" :src="scope.row.avatar" :preview-src-list="[scope.row.avatar]" hide-on-click-modal="true" preview-teleported="true"> </el-image> </template> </el-table-column>
到了這里,關(guān)于vue3+element-plus點(diǎn)擊列表中的圖片預(yù)覽時(shí),圖片被表格覆蓋的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!