Commit fce772e3 authored by “yiyousong”'s avatar “yiyousong”

feat: 表格组件添加插槽渲染

parent db760ce2
......@@ -9,8 +9,9 @@
v-bind="$attrs"
v-on="$listeners"
>
<template v-for="(v, i) in column">
<el-table-column
v-for="(v, i) in column"
v-if="!v.slot"
:key="i"
:reserve-selection="v.reserveSelection"
:prop="v.prop"
......@@ -25,6 +26,26 @@
:show-overflow-tooltip="v.showOverflowTooltip"
>
</el-table-column>
<el-table-column
v-else
:key="i"
:reserve-selection="v.reserveSelection"
:prop="v.prop"
:type="v.type"
:index="v.index"
:label="v.label"
:width="v.width"
:align="v.align"
:fixed="v.fixed"
:formatter="v.formatter"
:min-width="v.minWidth"
:show-overflow-tooltip="v.showOverflowTooltip"
>
<template slot-scope="scope">
<slot :name="v.prop" v-bind="scope"></slot>
</template>
</el-table-column>
</template>
</el-table>
</div>
</template>
......@@ -67,6 +88,7 @@ export default {
},
},
computed: {},
created() {},
methods: {
clearSelection() {
this.$refs.MyTable.clearSelection();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment