no message
Former-commit-id: b2edcad0be68c79f0b855971c008fa15c257c5a8 Former-commit-id: c4e7ff933adc61877672c9a00cf612d7a0ee4374 Former-commit-id: ac87fba94fcacaf158bd1ec3cbe0978eee82b892
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<Container>
|
<Container>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<el-tooltip effect="dark" content="生成数据需要几秒钟的时间" placement="top">
|
<el-tooltip effect="dark" content="生成数据需要几秒钟的时间 依电脑配置而定" placement="top">
|
||||||
<el-button @click="makeData">生成数据</el-button>
|
<el-button v-if="tableDataTemp.length === 0" @click="makeData">Mock 10,000 条数据</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-button @click="tableData = tableDataTemp">渲染数据</el-button>
|
<el-button v-if="tableDataTemp.length > 0" @click="tableData = tableDataTemp">渲染数据</el-button>
|
||||||
</div>
|
</div>
|
||||||
<table border="1" class="gridtable">
|
<table v-if="tableData.length > 0" border="1" class="gridtable">
|
||||||
<tr v-for="(item, index) in tableData" :key="index">
|
<tr v-for="(item, index) in tableData" :key="index">
|
||||||
<th v-for="(key, keyIndex) in Object.keys(item)" :key="keyIndex">{{item[key]}}</th>
|
<th v-for="(key, keyIndex) in Object.keys(item)" :key="keyIndex">{{item[key]}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -20,13 +20,13 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
tableDataTemp: [],
|
tableDataTemp: [],
|
||||||
tableData: [{}]
|
tableData: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
makeData () {
|
makeData () {
|
||||||
this.tableDataTemp = Mock.mock({
|
this.tableDataTemp = Mock.mock({
|
||||||
'list|5000': [{
|
'list|10000': [{
|
||||||
'id|+1': 1,
|
'id|+1': 1,
|
||||||
'name': '@CNAME',
|
'name': '@CNAME',
|
||||||
'num1': '@NATURAL(10, 1000)',
|
'num1': '@NATURAL(10, 1000)',
|
||||||
|
|||||||
Reference in New Issue
Block a user