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>
|
|
|
|
export default {
|
|
|
|
name: 'toggle',
|
2017-07-02 02:23:40 +00:00
|
|
|
props: ['value', 'desc'],
|
2017-06-25 02:45:23 +00:00
|
|
|
data () {
|
|
|
|
return { }
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
changeToggle() {
|
2017-07-02 02:23:40 +00:00
|
|
|
this.$emit('input', !this.value)
|
2017-06-25 02:45:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|