From b4a25eebe63c0a4d79c9eb993ec7b37e184b2f2a Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Mon, 13 Nov 2023 20:51:36 +0530 Subject: [PATCH] minor tweaks --- lib/components/STable.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/components/STable.vue b/lib/components/STable.vue index 9a2d0558..fe5a7c57 100644 --- a/lib/components/STable.vue +++ b/lib/components/STable.vue @@ -223,20 +223,20 @@ const actionsColumnWidth = computed(() => { const { actions } = cell - const widths = actions.map((action) => { + const widths = actions.map(({ icon, label }) => { // has only icon - if (action.icon && !action.label) { + if (icon && !label) { return 1 /* border */ + 5 /* padding */ + 16 /* icon */ + 5 /* padding */ + 1 /* border */ } // has only label - if (action.label && !action.icon) { - return 1 /* border */ + 12 /* padding */ + getTextWidth(action.label, font) + 12 /* padding */ + 1 /* border */ + if (label && !icon) { + return 1 /* border */ + 12 /* padding */ + getTextWidth(label, font) + 12 /* padding */ + 1 /* border */ } // has both icon and label - if (action.icon && action.label) { - return 1 /* border */ + 8 /* padding */ + 16 /* icon */ + 4 /* padding */ + getTextWidth(action.label, font) + 10 /* padding */ + 1 /* border */ + if (icon && label) { + return 1 /* border */ + 8 /* padding */ + 16 /* icon */ + 4 /* padding */ + getTextWidth(label, font) + 10 /* padding */ + 1 /* border */ } return 0