Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions src/components/Table/STableColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ export default class STableColumn extends Vue {
/**
* Column width in pixels. For instance, `width="80"`
*/
@Prop({ default: '', type: String }) readonly width!: string
@Prop({ type: String }) readonly width!: string
/**
* Column minimum width in pixels. Columns with `width` has a fixed width,
* while columns with `min-width` has a width that is distributed in proportion.
* For instance, `min-width="80"`
*/
@Prop({ default: '', type: String }) readonly minWidth!: string
@Prop({ type: String }) readonly minWidth!: string
/**
* Will column be fixed at `"left"` or `"right"` position.
* If it's not defined, then it will be not fixed by default.
Expand Down Expand Up @@ -190,11 +190,18 @@ export default class STableColumn extends Vue {
get computedWidth () {
const tableBorder = (this.sTable || {}).border
const size = (this.sTable || {}).size
return !this.width && this.type === 'selection' && !tableBorder && size ? ({
[Size.SMALL]: '30px',
[Size.MEDIUM]: '32px',
[Size.BIG]: '36px'
}[size]) : this.width
if (!this.width && this.type === 'selection' && size) {
return !tableBorder ? ({
[Size.SMALL]: '30',
[Size.MEDIUM]: '32',
[Size.BIG]: '36'
}[size]) : ({
[Size.SMALL]: '42',
[Size.MEDIUM]: '44',
[Size.BIG]: '48'
}[size])
}
return this.width
}
}
</script>