-
Notifications
You must be signed in to change notification settings - Fork 4
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
unknown
committed
Jan 14, 2020
1 parent
d2a7737
commit c5ec937
Showing
9 changed files
with
195 additions
and
32 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<template> | ||
<div class="test"> | ||
<flex-table | ||
:row-class-name="rowClassName" :selectedColor="'#90EE90'" :columns="column1" :data="data1"> | ||
</flex-table> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
column1: [ | ||
{ | ||
type: 'selection', | ||
width: 20, | ||
align: 'center', | ||
fixed: 'left', | ||
}, | ||
{ | ||
title: 'Name', | ||
key: 'name', | ||
}, | ||
{ | ||
title: 'Age', | ||
key: 'age', | ||
className: 'flag-one', | ||
}, | ||
{ | ||
title: 'Address', | ||
key: 'address', | ||
}, | ||
], | ||
data1: [ | ||
{ | ||
name: 'jack', | ||
age: '18', | ||
address: 'New York No. 1 Lake Park', | ||
cellClassName: { | ||
name: 'flag-two', | ||
}, | ||
}, | ||
{ | ||
name: 'jack2', | ||
age: '18', | ||
address: 'New York No. 1 Lake Park', | ||
}, | ||
{ | ||
name: 'jack', | ||
age: '18', | ||
address: 'New York No. 1 Lake Park', | ||
}, | ||
{ | ||
name: 'jack', | ||
age: '18', | ||
address: 'New York No. 1 Lake Park', | ||
}, | ||
{ | ||
name: 'jack', | ||
age: '18', | ||
address: 'New York No. 1 Lake Park', | ||
}, | ||
], | ||
} | ||
}, | ||
methods: { | ||
rowClassName (row, index) { | ||
if (index === 4) { | ||
return 'flag-three'; | ||
} | ||
if (row.name === 'jack2'){ | ||
return 'flag-four' | ||
} | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="less"> | ||
.flag-one{ | ||
background-color: yellow; | ||
} | ||
.flag-two{ | ||
background-color: Violet ; | ||
} | ||
.flag-four{ | ||
background-color: aquamarine; | ||
} | ||
.flag-three{ | ||
background-color: LightPink ; | ||
} | ||
</style> |
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
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