<el-table-column label="頭像" width="100"> <template scope="scope"> <img :src="scope.row.img" width="50" height="50" class="img"/> </template> </el-table-column>
el-table中渲染圖片,一般情況下如上所示。當圖片是另一個字段,要通過接口才能獲取到,此時該如何處理?
使用formatter屬性?去格式化指定列(圖片所在列)的值,
接受一個Function傳入兩個參數:row和column,根據自己的需求進行處理。
貌似不行。通過接口調用那列數據的時候,會進入死循環,浪費大量的系統資源,程序還會終止。