vuetifyjs / vuetify
1 1
import Vue, { VNode } from 'vue'
2

3 1
export default Vue.extend({
4
  name: 'row-group',
5

6
  functional: true,
7

8
  props: {
9
    value: {
10
      type: Boolean,
11
      default: true,
12
    },
13
    headerClass: {
14
      type: String,
15
      default: 'v-row-group__header',
16
    },
17
    contentClass: String,
18
    summaryClass: {
19
      type: String,
20
      default: 'v-row-group__summary',
21
    },
22
  },
23

24 1
  render (h, { slots, props }): VNode {
25 1
    const computedSlots = slots()
26 1
    const children = []
27

28 1
    if (computedSlots['column.header']) {
29 1
      children.push(h('tr', {
30
        staticClass: props.headerClass,
31
      }, computedSlots['column.header']))
32 1
    } else if (computedSlots['row.header']) {
33 1
      children.push(...computedSlots['row.header'])
34
    }
35

36 1
    if (computedSlots['row.content'] && props.value) children.push(...computedSlots['row.content'])
37

38 1
    if (computedSlots['column.summary']) {
39 1
      children.push(h('tr', {
40
        staticClass: props.summaryClass,
41
      }, computedSlots['column.summary']))
42 1
    } else if (computedSlots['row.summary']) {
43 1
      children.push(...computedSlots['row.summary'])
44
    }
45

46 1
    return children as any
47
  },
48
})

Read our documentation on viewing source code .

Loading