Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Nov 13, 2023
1 parent bdeeef5 commit b4a25ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/components/STable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b4a25ee

Please sign in to comment.