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