mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-21 23:37:55 +00:00
26 lines
577 B
JavaScript
26 lines
577 B
JavaScript
/**
|
|
* This mixin is for components that have the Modal component as root element.
|
|
* It will make it easier to call the root modal specific functions.
|
|
*/
|
|
export default {
|
|
methods: {
|
|
getRootModal() {
|
|
if (
|
|
this.$children.length > 0 &&
|
|
this.$children[0].$options.name === 'Modal'
|
|
) {
|
|
return this.$children[0]
|
|
}
|
|
},
|
|
toggle(...args) {
|
|
this.getRootModal().toggle(...args)
|
|
},
|
|
show(...args) {
|
|
this.getRootModal().show(...args)
|
|
},
|
|
hide(...args) {
|
|
this.getRootModal().hide(...args)
|
|
},
|
|
},
|
|
}
|