Vue+style 動態樣式繫結(收藏圖示)
阿新 • • 發佈:2021-03-25
主要程式碼:
0:未收藏
1:已收藏
<vab-icon :icon="row.is_collect == 1 ? 'star-fill' : 'star-line'" :style="{ color: row.is_collect == 1 ? 'orange' : '' }" />
效果截圖:
程式碼:
<el-table v-loading="listLoading" :data="grouplist" border > <el-table-column align="center" type="selection" /> <el-table-column align="center" width="55"> <template #default="{ row }"> <vab-icon :icon="row.is_collect == 1 ? 'star-fill' : 'star-line'" :style="{ color: row.is_collect == 1 ? 'orange' : '' }" /> </template> </el-table-column> </el-table>