mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 00:08:25 +00:00
Update the nuxt3 version. Co-authored-by: Jonathan Adeline <jonathan@baserow.io> Co-authored-by: Bram Wiepjes <bramw@protonmail.com> Co-authored-by: Cezary <cezary@baserow.io> Co-authored-by: Tsering Paljor <tsering@baserow.io> Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io> Co-authored-by: Bram <bram2w@users.noreply.github.com>
33 lines
845 B
JavaScript
33 lines
845 B
JavaScript
/**
|
|
* Allow to wrap a component with a list of components + props. This is a render
|
|
* function instead of a template to avoid extra div and improve performances.
|
|
*/
|
|
import { h } from 'vue'
|
|
|
|
export default {
|
|
name: 'RecursiveWrapper',
|
|
props: {
|
|
components: {
|
|
type: Array,
|
|
required: true,
|
|
},
|
|
firstComponentClass: { type: String, required: false, default: null },
|
|
},
|
|
render() {
|
|
const rec = ([first, ...rest], firstComponentClass = null) => {
|
|
if (first) {
|
|
const props = { ...(first.props || {}) }
|
|
if (firstComponentClass) props.class = firstComponentClass
|
|
|
|
return h(first.component, props, {
|
|
default: () => rec(rest),
|
|
})
|
|
}
|
|
|
|
return this.$slots.default ? this.$slots.default() : []
|
|
}
|
|
|
|
return rec(this.components, this.firstComponentClass)
|
|
},
|
|
}
|