diff options
Diffstat (limited to 'src/components/Mixins')
-rw-r--r-- | src/components/Mixins/TableDataFormatter.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/components/Mixins/TableDataFormatter.js b/src/components/Mixins/TableDataFormatter.js new file mode 100644 index 00000000..5dbe40ad --- /dev/null +++ b/src/components/Mixins/TableDataFormatter.js @@ -0,0 +1,25 @@ +const TableDataFormatter = { + methods: { + tableFormatter(value) { + if (value === undefined || value === '') { + return '--'; + } else { + return value; + } + }, + statusIcon(status) { + switch (status) { + case 'OK': + return 'success'; + case 'Warning': + return 'warning'; + case 'Critical': + return 'danger'; + default: + return ''; + } + } + } +}; + +export default TableDataFormatter; |