export default { name: 'ElDescriptionsRow', props: { row: { type: Array } }, inject: ['elDescriptions'], render(h) { const { elDescriptions } = this; const row = (this.row || []).map(item => { return { ...item, label: item.slots.label || item.props.label, ...['labelClassName', 'contentClassName', 'labelStyle', 'contentStyle'].reduce((res, key) => { res[key] = item.props[key] || elDescriptions[key]; return res; }, {}) }; }); if (elDescriptions.direction === 'vertical') { return ( { row.map(item => { return ( {item.label} ); }) } { row.map(item =>{ return ( {item.slots.default} ); }) } ); } if (elDescriptions.border) { return ( { row.map(item=> { return ([ {item.label}, {item.slots.default} ]); }) } ); } return ( { row.map(item=> { return (
{item.label} {item.slots.default}
); }) } ); } };