From 8047ae3d83ba0718fb7a42907036157e5c680b85 Mon Sep 17 00:00:00 2001 From: "Andrey V.Kosteltsev" Date: Mon, 4 Jul 2022 23:59:32 +0300 Subject: IBS: _sila UI theme --- src/components/_sila/Mixins/TableSortMixin.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/components/_sila/Mixins/TableSortMixin.js (limited to 'src/components/_sila/Mixins/TableSortMixin.js') diff --git a/src/components/_sila/Mixins/TableSortMixin.js b/src/components/_sila/Mixins/TableSortMixin.js new file mode 100644 index 00000000..c0997350 --- /dev/null +++ b/src/components/_sila/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; -- cgit v1.2.3