Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄瑜
VueElementTemplate
Commits
0b60ba74
Commit
0b60ba74
authored
Feb 05, 2018
by
胡小根
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add schema to component table
parent
b73b0d5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
+49
-2
HmComplexTable.vue
src/views/haomo/components/tables/HmComplexTable.vue
+43
-0
index.vue
src/views/haomo/components/tables/index.vue
+6
-2
No files found.
src/views/haomo/components/tables/HmComplexTable.vue
View file @
0b60ba74
...
...
@@ -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
}
...
...
src/views/haomo/components/tables/index.vue
View file @
0b60ba74
<
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
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment