atst/js/components/toggler.js
2018-08-22 13:29:25 -04:00

25 lines
404 B
JavaScript

export default {
name: 'toggler',
data: function () {
return {
isVisible: false
}
},
render: function (createElement) {
return createElement( this.$vnode.data.tag, [
this.$scopedSlots.default({
isVisible: this.isVisible,
toggle: this.toggle
})
])
},
methods: {
toggle: function (e) {
this.isVisible = !this.isVisible
}
}
}