Files
vxe-table/examples/main.js
xuliangzhan bfce9c2201 update
2019-04-24 23:43:20 +08:00

44 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/index.js'
import './mock'
Vue.config.productionTip = false
// 后台异步生成70万数据为了避免大量运算卡主页面生成大约需要15秒左右
var list = window.CACHE_DATA_LIST = []
var currTime = Date.now()
var fullIndex = 0
var size = 100000
function mockData () {
for (var index = 0; index < 1500; index++) {
currTime += 5000
fullIndex++
list.push({
id: fullIndex,
name: 'name_' + fullIndex,
checked: false,
date: currTime,
sex: index % 3 ? '0' : '1',
age: index % 4 === 0 ? 30 : index % 3 === 0 ? 28 : index % 2 === 0 ? 26 : 24,
region: index % 4 === 0 ? [19, 199, 1773] : index % 3 === 0 ? [9, 73, 719] : [1, 1, 5],
rate: index % 4 === 0 ? 4 : index % 3 === 0 ? 3 : index % 2 === 0 ? 2 : 1,
address: `地址 地址地址 地址地址地址${index}`,
updateTime: currTime,
createTime: currTime
})
}
if (fullIndex < size) {
setTimeout(mockData, 30)
}
}
mockData()
new Vue({
router,
render: h => h(App)
}).$mount('#app')