Table column add new prop: display

This commit is contained in:
梁灏 2020-04-08 16:33:54 +08:00
parent 76c5a5ea6f
commit 8529369e31
3 changed files with 21 additions and 2 deletions

View file

@ -35,6 +35,7 @@
v-if="renderType === 'slot'"
:row="row"
:column="column"
:display="column.display || 'block'"
:index="index"></table-slot>
</div>
</template>

View file

@ -8,13 +8,23 @@ export default {
column: {
type: Object,
default: null
},
display: {
type: String,
default: 'block'
}
},
render: (h, ctx) => {
return h('div', ctx.injections.tableRoot.$scopedSlots[ctx.props.column.slot]({
return h('div', {
'class': {
'ivu-table-cell-slot': true,
'ivu-table-cell-slot-inline': ctx.props.display === 'inline',
'ivu-table-cell-slot-inline-block': ctx.props.display === 'inline-block'
}
}, ctx.injections.tableRoot.$scopedSlots[ctx.props.column.slot]({
row: ctx.props.row,
column: ctx.props.column,
index: ctx.props.index
}));
}
};
};

View file

@ -289,6 +289,14 @@
height: 16px;
}
}
&-slot{
&-inline{
display: inline;
}
&-inline-block{
display: inline-block;
}
}
}
&-hidden{
visibility: hidden;