export default {
functional: true,
render (h, context) {
return h(
'el-row',
context.data,
context.children.map(item => {
const tag = item.componentOptions ? item.componentOptions.tag : ''
if (tag === 'el-col' || tag === 'elCol') {
return item
}
return h('el-col', JSON.parse(JSON.stringify(context.data)), [item])
})
)
}
}
<template>
<row-col :gutter="20" :xs="24" :sm="12" :md="8" :lg="6">
<div>1</div>
<div>2</div>
</row-col>
</template>