Toggler component
This commit is contained in:
parent
e38bc2fa63
commit
eb04321277
28
js/components/toggler.js
Normal file
28
js/components/toggler.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
@ -8,13 +8,14 @@ import checkboxinput from './components/checkbox_input'
|
|||||||
import DetailsOfUse from './components/forms/details_of_use'
|
import DetailsOfUse from './components/forms/details_of_use'
|
||||||
import poc from './components/forms/poc'
|
import poc from './components/forms/poc'
|
||||||
import financial from './components/forms/financial'
|
import financial from './components/forms/financial'
|
||||||
|
import toggler from './components/toggler'
|
||||||
|
|
||||||
Vue.use(VTooltip)
|
Vue.use(VTooltip)
|
||||||
|
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
el: '#app-root',
|
el: '#app-root',
|
||||||
components: {
|
components: {
|
||||||
|
toggler,
|
||||||
optionsinput,
|
optionsinput,
|
||||||
textinput,
|
textinput,
|
||||||
checkboxinput,
|
checkboxinput,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user