Commit d0c65d4d authored by 周远喜's avatar 周远喜

treetable 完成

parent fc14e32c
export default {
name: 'ColumnSlot',
functional: true,
inject: ['slots'],
props: {
row: Object,
index: Number,
......@@ -10,7 +11,7 @@ export default {
}
},
render: (h, ctx) => {
return h('div', ctx.injections.$scopedSlots[ctx.props.column.slot]({
return h('span', ctx.injections.slots()[ctx.props.column.slot]({
row: ctx.props.row,
column: ctx.props.column,
index: ctx.props.index
......
This diff is collapsed.
<template>
<div class="tree">
<TreeGrid :columns="columns" :items="treeData">
<template slot-scope="row" slot="action">
<strong>{{ row.id }}</strong>
<template slot-scope="{row,column,index}" slot="name">
<Icon type="md-folder" /> {{row.name}}
</template>
<template slot-scope="{row,column,index}" slot="action">
<strong>{{row.action}}</strong>
</template>
</TreeGrid>
<!-- <Input v-model="data" type="textarea" rows="20" placeholder=""></Input> -->
......@@ -16,20 +19,28 @@ export default {
data() {
return {
columns: [
{
type: "selection",
width:50,
align:"center"
},
{
key: "name",
title: "名称",
tree:true,
slot:"name"
},
{
key: "status",
title: "状态",
width: "100",
width: "100"
},
{
key: "action",
title: "操作",
width: "100",
solt:"action"
sortable:true,
slot:"action"
},
],
treeData1: [],
......@@ -56,6 +67,7 @@ export default {
},
mounted() {
// this.init();
},
methods: {
init() {
......
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