atst/js/components/toggler.js
2018-08-22 11:05:37 -04:00

29 lines
457 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
}
},
mounted: function () {
console.log(this)
}
}