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

ok

parent fed1e7bb
export default {
name: 'ColumnSlot',
functional: true,
props: {
row: Object,
index: Number,
column: {
type: Object,
default: null
}
},
render: (h, ctx) => {
return h('div', ctx.injections.$scopedSlots[ctx.props.column.slot]({
row: ctx.props.row,
column: ctx.props.column,
index: ctx.props.index
}));
}
};
\ No newline at end of file
......@@ -122,12 +122,18 @@
{{renderBody(item,column) }}
</label>
<table-expand
v-if="column.render&&!column.type"
v-if="column.render&&!column.type&&!column.solt"
:row="item"
:column="column"
:index="snum"
:render="column.render"
></table-expand>
<!-- <column-slot v-if="column.slot"
:row="item"
:column="column"
:index="snum"></column-slot> -->
{{column.solt}}
<slot v-if="column.solt" v-bind:="item">fsafd</slot>
</td>
</tr>
</tbody>
......@@ -136,9 +142,10 @@
</template>
<script>
import TableExpand from "./expand";
import ColumnSlot from "./columnSolt"
export default {
name: "treeGrid",
components: { TableExpand },
components: { TableExpand ,ColumnSlot},
props: {
columns: Array,
items: {
......
export default {
name: 'TableSlot',
functional: true,
inject: ['tableRoot'],
props: {
row: Object,
index: Number,
column: {
type: Object,
default: null
}
},
render: (h, ctx) => {
return h('div', ctx.injections.tableRoot.$scopedSlots[ctx.props.column.slot]({
row: ctx.props.row,
column: ctx.props.column,
index: ctx.props.index
}));
}
};
\ No newline at end of file
......@@ -17,13 +17,13 @@
<template>
<div class="flex fd test_layout">
<div>
<Menu mode="horizontal" theme="light" active-name="0">
<Menu mode="horizontal" theme="light" active-name="a0">
<div class="layout-assistant">
<MenuItem name="0" to="/test/example">基础组件</MenuItem>
<MenuItem name="1" to="/test/user">人员选择</MenuItem>
<MenuItem name="2" to="/test/com">异步组件</MenuItem>
<MenuItem name="4" to="/test/resource">资源选择</MenuItem>
<MenuItem name="3" to="/test/view">详情拖拽排版</MenuItem>
<MenuItem name="a0" to="/test/example">基础组件</MenuItem>
<MenuItem name="a1" to="/test/user">人员选择</MenuItem>
<MenuItem name="a2" to="/test/com">异步组件</MenuItem>
<MenuItem name="a4" to="/test/resource">资源选择</MenuItem>
<MenuItem name="a3" to="/test/view">详情拖拽排版</MenuItem>
</div>
</Menu>
</div>
......
......@@ -20,6 +20,7 @@ export const exampleRouter = [
{
route: '/test/example/tree',
title: '树',
name: 'tree',
icon: 'md-aperture'
},
{
......
<template>
<div class="tree">
<TreeGrid :columns="columns" :items="treeData"></TreeGrid>
<Input v-model="data" type="textarea" rows="20" placeholder=""></Input>
<TreeGrid :columns="columns" :items="treeData">
<template slot-scope="row" slot="action">
<strong>{{ row.id }}</strong>
</template>
</TreeGrid>
<!-- <Input v-model="data" type="textarea" rows="20" placeholder=""></Input> -->
</div>
</template>
......@@ -25,6 +29,7 @@ export default {
key: "action",
title: "操作",
width: "100",
solt:"action"
},
],
treeData1: [],
......
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