vuetifyjs / vuetify
1 1
import './VSimpleTable.sass'
2

3 1
import { convertToUnit } from '../../util/helpers'
4 1
import Themeable from '../../mixins/themeable'
5 1
import mixins from '../../util/mixins'
6
import { VNode } from 'vue'
7

8 1
export default mixins(Themeable).extend({
9
  name: 'v-simple-table',
10

11
  props: {
12
    dense: Boolean,
13
    fixedHeader: Boolean,
14
    height: [Number, String],
15
  },
16

17
  computed: {
18 1
    classes (): Record<string, boolean> {
19 1
      return {
20
        'v-data-table--dense': this.dense,
21 1
        'v-data-table--fixed-height': !!this.height && !this.fixedHeader,
22
        'v-data-table--fixed-header': this.fixedHeader,
23
        ...this.themeClasses,
24
      }
25
    },
26
  },
27

28
  methods: {
29 1
    genWrapper () {
30 1
      return this.$slots.wrapper || this.$createElement('div', {
31
        staticClass: 'v-data-table__wrapper',
32
        style: {
33
          height: convertToUnit(this.height),
34
        },
35
      }, [
36
        this.$createElement('table', this.$slots.default),
37
      ])
38
    },
39
  },
40

41 1
  render (h): VNode {
42 1
    return h('div', {
43
      staticClass: 'v-data-table',
44
      class: this.classes,
45
    }, [
46
      this.$slots.top,
47
      this.genWrapper(),
48
      this.$slots.bottom,
49
    ])
50
  },
51
})

Read our documentation on viewing source code .

Loading