diff options
Diffstat (limited to 'src/components/Mixins')
-rw-r--r-- | src/components/Mixins/TableSortMixin.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/components/Mixins/TableSortMixin.js b/src/components/Mixins/TableSortMixin.js new file mode 100644 index 00000000..7e988503 --- /dev/null +++ b/src/components/Mixins/TableSortMixin.js @@ -0,0 +1,11 @@ +const STATUS = ['OK', 'Warning', 'Critical']; + +const TableSortMixin = { + methods: { + sortStatus(a, b, key) { + return STATUS.indexOf(a[key]) - STATUS.indexOf(b[key]); + } + } +}; + +export default TableSortMixin; |