[Solved] DataTable display a column with icon
-
Is that possible that DataTable display a column with icon only?
-
Yes. Use a scoped slot for that column.
-
Here is my column with icon:
<q-icon :name="getDownloadStatusIcon(props)" /> </q-td>
And the function:
getDownloadStatusIcon: function (props) { let downloaded = props.row.downloaded let snapshots = true if (!downloaded) { // check with attachments props.row.attachments.forEach((attachment) => { if (!attachment.snapshotName) { snapshots = false } }) } if (!downloaded && !snapshots) { return 'fas fa-spinner fa-lg fa-spin' } else if (!downloaded && snapshots) { return 'fas fa-image fa-lg' } else { return 'fas fa-video fa-lg' } },
Hope it helps!
-
@hawkeye64 Thank you! It works now.