Blame view

src/components/table/table-head.vue 878 Bytes
2cb8a6d9   梁灏   commit Table comp...
1
2
3
  <template>
      <thead>
          <tr>
744eb0af   梁灏   update Table comp...
4
              <th v-for="column in columns" :class="fixedCls(column)">{{{ renderHeader(column, $index) }}}</th>
2cb8a6d9   梁灏   commit Table comp...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
          </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 || '#';
                  }
744eb0af   梁灏   update Table comp...
29
30
31
              },
              fixedCls (column) {
                  return column.fixed ? `${this.prefixCls}-${column.fixed}` : '';
2cb8a6d9   梁灏   commit Table comp...
32
33
34
35
              }
          }
      }
  </script>