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

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

parent db760ce2
...@@ -9,22 +9,43 @@ ...@@ -9,22 +9,43 @@
v-bind="$attrs" v-bind="$attrs"
v-on="$listeners" v-on="$listeners"
> >
<el-table-column <template v-for="(v, i) in column">
v-for="(v, i) in column" <el-table-column
:key="i" v-if="!v.slot"
:reserve-selection="v.reserveSelection" :key="i"
:prop="v.prop" :reserve-selection="v.reserveSelection"
:type="v.type" :prop="v.prop"
:index="v.index" :type="v.type"
:label="v.label" :index="v.index"
:width="v.width" :label="v.label"
:align="v.align" :width="v.width"
:fixed="v.fixed" :align="v.align"
:formatter="v.formatter" :fixed="v.fixed"
:min-width="v.minWidth" :formatter="v.formatter"
:show-overflow-tooltip="v.showOverflowTooltip" :min-width="v.minWidth"
> :show-overflow-tooltip="v.showOverflowTooltip"
</el-table-column> >
</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> </el-table>
</div> </div>
</template> </template>
...@@ -67,6 +88,7 @@ export default { ...@@ -67,6 +88,7 @@ export default {
}, },
}, },
computed: {}, computed: {},
created() {},
methods: { methods: {
clearSelection() { clearSelection() {
this.$refs.MyTable.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