set cookie for sidebar preference
This commit is contained in:
23
js/mixins/toggle.js
Normal file
23
js/mixins/toggle.js
Normal file
@@ -0,0 +1,23 @@
|
||||
export default {
|
||||
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
|
||||
},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user