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'" v-if="renderType === 'slot'"
:row="row" :row="row"
:column="column" :column="column"
:display="column.display || 'block'"
:index="index"></table-slot> :index="index"></table-slot>
</div> </div>
</template> </template>

View file

@ -8,10 +8,20 @@ export default {
column: { column: {
type: Object, type: Object,
default: null default: null
},
display: {
type: String,
default: 'block'
} }
}, },
render: (h, ctx) => { 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, row: ctx.props.row,
column: ctx.props.column, column: ctx.props.column,
index: ctx.props.index index: ctx.props.index

View file

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