commit Table component
commit Table component
This commit is contained in:
parent
d2e82cd7f6
commit
2cb8a6d93e
12 changed files with 334 additions and 0 deletions
32
src/components/table/table-head.vue
Normal file
32
src/components/table/table-head.vue
Normal file
|
@ -0,0 +1,32 @@
|
|||
<template>
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="column in columns">{{{ renderHeader(column, $index) }}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
prefixCls: String,
|
||||
columns: Array
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
renderHeader (column, $index) {
|
||||
if ('renderHeader' in this.columns[$index]) {
|
||||
return this.columns[$index].renderHeader(column, $index);
|
||||
} else {
|
||||
return column.title || '#';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue