set cookie for sidebar preference

This commit is contained in:
dandds
2019-02-11 13:52:18 -05:00
parent cfd871716b
commit 35b87ff091
5 changed files with 60 additions and 23 deletions

View File

@@ -1,32 +1,14 @@
import ToggleMixin from '../mixins/toggle'
export default {
name: 'toggler',
mixins: [ToggleMixin],
props: {
defaultVisible: {
type: Boolean,
default: () => false,
},
},
data: function() {
return {
isVisible: this.defaultVisible,
}
},
render: function(createElement) {
return createElement(this.$vnode.data.tag, [
this.$scopedSlots.default({
isVisible: this.isVisible,
toggle: this.toggle,
}),
])
},
methods: {
toggle: function(e) {
e.preventDefault()
this.isVisible = !this.isVisible
},
},
}