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