SOURCE

console 命令行工具 X clear

                    
>
console
var Main = {
  data() {
    return {
      tableColumn: [
        { type: 'index', width: 50 },
        {
          title: '基本信息',
          children: [
            { field: 'name', title: 'Name' },
            {
              title: '其他信息',
              children: [
                { field: 'num', title: 'Number' },
                { field: 'date', title: 'Date' }
              ]
            },
            { field: 'sex', title: 'Sex' }
          ]
        },
        { field: 'address', title: 'Address', showOverflow: true }
      ],
      tableData: []
    }
  },
  created () {
    var list = []
    for(var index = 0; index < 20; index++){
      list.push({
        id: index + 10000,
        checked: false,
        name: 'test' + index,
        role: 'developer',
        sex: 'Man',
        date: '2019-05-01',
        num: index+10,
        region: 'ShenZhen',
        address: 'address abc' + index
      })
    }
    this.tableData = list
  },
  methods: {
    footerMethod ({ columns, data }) {
      return [
        columns.map((column, columnIndex) => {
          if (columnIndex === 0) {
            return '和值'
          }
          if (['num'].includes(column.property)) {
            return XEUtils.sum(data, column.property)
          }
          return '-'
        })
      ]
    }
  }
};
var Ctor = Vue.extend(Main);
new Ctor().$mount('#app')
<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/xe-utils"></script>
<script src="//unpkg.com/vxe-table"></script>

<div id="app">
  <template>
    <div>
      <vxe-grid
        border
        show-footer
        height="400"
        :footer-method="footerMethod"
        :columns="tableColumn"
        :data="tableData"></vxe-grid>
    </div>
  </template>
</div>
@import url("//unpkg.com/vxe-table/lib/index.css");