dashboard/shell/mixins/compact-input.ts

27 lines
480 B
TypeScript

import Vue from 'vue';
export default Vue.extend({
props: {
compact: {
type: Boolean,
default: null
},
label: {
type: String,
default: null
},
labelKey: {
type: String,
default: null
},
},
computed: {
isCompact(): boolean {
// Compact if explicitly set - otherwise compact if there is no label
return this.compact !== null ? this.compact : !(this.label || this.labelKey);
}
}
});