25 lines
404 B
JavaScript
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
|
|
}
|
|
}
|
|
}
|