Commit 0b60ba74 authored by 胡小根's avatar 胡小根

add schema to component table

parent b73b0d5f
......@@ -168,7 +168,50 @@
// 混入公共对象
mixins: [],
props: {
/**
* 组件所使用的表定义schema。表定义schema,请使用 model2codejs 从pdm文件生成schema
*/
schema: {
type: Object,
required: true
},
/**
* 搜索过滤选项。默认没有过滤功能
*/
filters: {
type: Array,
required: false
},
/**
* 指定要显示的列。默认为根据schema得到的所有列。完整示例为:
* [
* {
* "name": "姓名",
* "code": "username",
* "render": function(value){
* return "<a href='value'></a>"
* }
* }
* ]
*/
columns: {
type: Array,
required: false
},
/**
* 修改行数据的Hook函数。参数为行数据 rowData
*/
rowHook: {
type: Function,
required: false
},
/**
* 表格的选项,包括:page_size。完整的示例为:
* {
* "page_size": 10, // 默认为10条数据/页
* }
*/
options: {
type: Object,
required: false
}
......
<template>
<div class="app-container calendar-list-container">
<hm-complex-table></hm-complex-table>
<hm-complex-table :schema="schema">
</hm-complex-table>
</div>
</template>
<script>
import HmComplexTable from './HmComplexTable.vue'
import schema from '../../schema'
export default {
name: 'HmComplexTable',
......@@ -20,7 +22,9 @@
},
filters: {
},
created() {},
created() {
this.schema = schema['HmUser']
},
methods: {}
}
</script>
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