SOURCE

console 命令行工具 X clear

                    
>
console
var Main = {
  data() {
    return {
      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',
        time: 1556677810888 + index * 500,
        region: 'ShenZhen',
        address: 'address abc' + index
      })
    }
    this.tableData = list
  },
  methods: {
    formatTime ({ cellValue, row, column }) {
      return XEUtils.toDateString(cellValue)
    }
  }
};
var Ctor = Vue.extend(Main);
new Ctor().$mount('#app')
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/xe-utils"></script>
<script src="https://cdn.jsdelivr.net/npm/vxe-table"></script>
<!-- 使用 cdn 引用方式需要注意是否锁定版本,默认指向最新版本 -->

<div id="app">
  <template>
    <div>
      <vxe-toolbar>
        <template v-slot:buttons>
          <vxe-button>新增</vxe-button>
          <vxe-button>
            <template>下拉按钮</template>
            <template v-slot:dropdowns>
              <vxe-button>删除</vxe-button>
              <vxe-button>保存</vxe-button>
            </template>
          </vxe-button>
        </template>
        <template v-slot:tools>
          <vxe-input size="small" placeholder="搜索"></vxe-input>
        </template>
      </vxe-toolbar>
      
      <vxe-table 
        border
        height="400"
        :data="tableData">
        <vxe-table-column type="seq" width="60"></vxe-table-column>
        <vxe-table-column field="name" title="Name" sortable>
          <template v-slot="{ row }">
            <a href="https://github.com/xuliangzhan/vxe-table">{{ row.name }}</a>
          </template>
        </vxe-table-column>
        <vxe-table-column field="sex" title="Sex"></vxe-table-column>
        <vxe-table-column field="time" title="Time" :formatter="formatTime"></vxe-table-column>
        <vxe-table-column field="address" title="Address"></vxe-table-column>
      </vxe-table>
    </div>
  </template>
</div>
@import url("https://cdn.jsdelivr.net/npm/vxe-table/lib/style.css");