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

treetable 完成

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