toggle.vue 392 Bytes
Newer Older
1
<template lang="pug">
NGPixel's avatar
NGPixel committed
2
  .toggle(:class='{ "is-active": value }', @click='changeToggle')
3 4 5 6 7 8 9 10
    .toggle-container
      .toggle-pin
    .toggle-text {{ desc }}
</template>

<script>
  export default {
    name: 'toggle',
NGPixel's avatar
NGPixel committed
11
    props: ['value', 'desc'],
12 13 14 15 16
    data () {
      return { }
    },
    methods: {
      changeToggle() {
NGPixel's avatar
NGPixel committed
17
        this.$emit('input', !this.value)
18 19 20 21
      }
    }
  }
</script>