1
// Directives
2 1
import ripple from '../../directives/ripple'
3

4
// Types
5 1
import Vue, { VNode, VNodeData, VNodeDirective } from 'vue'
6

7 1
export default Vue.extend({
8
  name: 'rippleable',
9

10
  directives: { ripple },
11

12
  props: {
13
    ripple: {
14
      type: [Boolean, Object],
15
      default: true,
16
    },
17
  },
18

19
  methods: {
20 1
    genRipple (data: VNodeData = {}): VNode | null {
21 1
      if (!this.ripple) return null
22

23 1
      data.staticClass = 'v-input--selection-controls__ripple'
24

25 1
      data.directives = data.directives || []
26 1
      data.directives.push({
27
        name: 'ripple',
28
        value: { center: true },
29
      } as VNodeDirective)
30

31 1
      return this.$createElement('div', data)
32
    },
33
  },
34
})

Read our documentation on viewing source code .

Loading