2017-06-25 02:45:23 +00:00
|
|
|
<template lang="pug">
|
2017-07-02 02:23:40 +00:00
|
|
|
.toggle(:class='{ "is-active": value }', @click='changeToggle')
|
2017-06-25 02:45:23 +00:00
|
|
|
.toggle-container
|
|
|
|
.toggle-pin
|
|
|
|
.toggle-text {{ desc }}
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2017-10-30 01:36:05 +00:00
|
|
|
export default {
|
|
|
|
name: 'toggle',
|
|
|
|
props: ['value', 'desc'],
|
|
|
|
data () {
|
|
|
|
return { }
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
changeToggle() {
|
|
|
|
this.$emit('input', !this.value)
|
2017-06-25 02:45:23 +00:00
|
|
|
}
|
|
|
|
}
|
2017-10-30 01:36:05 +00:00
|
|
|
}
|
2017-06-25 02:45:23 +00:00
|
|
|
</script>
|