wikijs-fork/client/js/components/toggle.vue

22 lines
392 B
Vue
Raw Normal View History

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