-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhigang.li
committed
Nov 16, 2018
1 parent
56742b7
commit e33acdc
Showing
8 changed files
with
227 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
<template> | ||
<div> | ||
<Card shadow> | ||
树状表格组件tree-table-vue,基于<a href="https://github.com/MisterTaki/vue-table-with-tree-grid">vue-table-with-tree-grid</a>进行开发,修复了一些bug,添加了一些新属性 | ||
<p><b>支持使用slot-scope进行自定义列渲染内容</b></p> | ||
<p>文档请看<a href="https://github.com/lison16/tree-table-vue">https://github.com/lison16/tree-table-vue</a></p> | ||
<tree-table expand-key="sex" :expand-type="false" :selection-type="false" :columns="columns" :data="data" > | ||
<template slot="likes" slot-scope="scope"> | ||
<Button @click="handle(scope)">123</Button> | ||
</template> | ||
</tree-table> | ||
</Card> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'tree_table_page', | ||
data () { | ||
return { | ||
columns: [ | ||
{ | ||
label: 'name', | ||
prop: 'name', | ||
width: '400px' | ||
}, | ||
{ | ||
label: 'sex', | ||
prop: 'sex', | ||
minWidth: '50px' | ||
}, | ||
{ | ||
label: 'score', | ||
prop: 'score' | ||
}, | ||
{ | ||
label: 'likes', | ||
prop: 'likes', | ||
minWidth: '200px', | ||
type: 'template', | ||
template: 'likes' | ||
} | ||
], | ||
data: [ | ||
{ | ||
name: 'Jack', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 10, | ||
children: [ | ||
{ | ||
name: 'Ashley', | ||
sex: 'female', | ||
likes: ['football', 'basketball'], | ||
score: 20, | ||
children: [ | ||
{ | ||
name: 'Ashley', | ||
sex: 'female', | ||
likes: ['football', 'basketball'], | ||
score: 20 | ||
}, | ||
{ | ||
name: 'Taki', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 10, | ||
children: [ | ||
{ | ||
name: 'Ashley', | ||
sex: 'female', | ||
likes: ['football', 'basketball'], | ||
score: 20 | ||
}, | ||
{ | ||
name: 'Taki', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 10, | ||
children: [ | ||
{ | ||
name: 'Ashley', | ||
sex: 'female', | ||
likes: ['football', 'basketball'], | ||
score: 20 | ||
}, | ||
{ | ||
name: 'Taki', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 10 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
name: 'Taki', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 10 | ||
} | ||
] | ||
}, | ||
{ | ||
name: 'Tom', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 20, | ||
children: [ | ||
{ | ||
name: 'Ashley', | ||
sex: 'female', | ||
likes: ['football', 'basketball'], | ||
score: 20, | ||
children: [ | ||
{ | ||
name: 'Ashley', | ||
sex: 'female', | ||
likes: ['football', 'basketball'], | ||
score: 20 | ||
}, | ||
{ | ||
name: 'Taki', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 10 | ||
} | ||
] | ||
}, | ||
{ | ||
name: 'Taki', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 10, | ||
children: [ | ||
{ | ||
name: 'Ashley', | ||
sex: 'female', | ||
likes: ['football', 'basketball'], | ||
score: 20 | ||
}, | ||
{ | ||
name: 'Taki', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 10 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
name: 'Tom', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 20 | ||
}, | ||
{ | ||
name: 'Tom', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 20, | ||
children: [ | ||
{ | ||
name: 'Ashley', | ||
sex: 'female', | ||
likes: ['football', 'basketball'], | ||
score: 20 | ||
}, | ||
{ | ||
name: 'Taki', | ||
sex: 'male', | ||
likes: ['football', 'basketball'], | ||
score: 10 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
methods: { | ||
handle (scope) { | ||
console.log(scope) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |