tableCommon.vue
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<template>
<!--
调用: {
tableData, // 表格内容数据 array object
headData, // 表格表头数据 array object
tabHeight, // 是否固定头部 string: no | number: yes
}
-->
<el-table
class="asis-table"
:data="tableData"
header-row-class-name="asis-table-head"
:height="typeof tabHeight === 'number' ? tabHeight : null"
style="width: 100%">
<el-table-column :prop="item.prop" :label="item.label" align="center" v-for="item in headData" :key="item.prop">
</el-table-column>
</el-table>
</template>
<script>
export default {
props: {
tableData: {
type: Array,
default: []
},
headData: {
type: Array,
default: []
},
tabHeight: [Number, String]
},
data () {
return {
//
}
},
methods: {
i18nFomatter(title){
let langeuageTitle = 'echartsTitle.' + title;
return this.$t(langeuageTitle)
},
}
}
</script>