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'"
|
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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -289,6 +289,14 @@
|
||||||
height: 16px;
|
height: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&-slot{
|
||||||
|
&-inline{
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
&-inline-block{
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&-hidden{
|
&-hidden{
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
|
|
Loading…
Add table
Reference in a new issue