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

22 lines
368 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>
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-10-30 01:36:05 +00:00
}
</script>