mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-05-20 15:39:35 +00:00
🌈 1️⃣ - Row coloring v1 - Lays the frontend foundations
This commit is contained in:
parent
c2d68b6e74
commit
b24e777db0
70 changed files with 4200 additions and 210 deletions
web-frontend/modules/database/components
25
web-frontend/modules/database/components/RecursiveWrapper.js
Normal file
25
web-frontend/modules/database/components/RecursiveWrapper.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
export default {
|
||||
name: 'RecursiveWrapper',
|
||||
functional: true,
|
||||
props: {
|
||||
components: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
render(h, context) {
|
||||
const rec = ([first, ...rest]) => {
|
||||
if (first) {
|
||||
return h(first.component, { props: first.props }, rec(rest))
|
||||
} else {
|
||||
return context.slots().default
|
||||
}
|
||||
}
|
||||
|
||||
return rec(context.props.components)
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue