Table column add new prop: display
This commit is contained in:
parent
76c5a5ea6f
commit
8529369e31
3 changed files with 21 additions and 2 deletions
|
@ -35,6 +35,7 @@
|
|||
v-if="renderType === 'slot'"
|
||||
:row="row"
|
||||
:column="column"
|
||||
:display="column.display || 'block'"
|
||||
:index="index"></table-slot>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -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
|
||||
}));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -289,6 +289,14 @@
|
|||
height: 16px;
|
||||
}
|
||||
}
|
||||
&-slot{
|
||||
&-inline{
|
||||
display: inline;
|
||||
}
|
||||
&-inline-block{
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-hidden{
|
||||
visibility: hidden;
|
||||
|
|
Loading…
Add table
Reference in a new issue