-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvx-table.html
151 lines (146 loc) · 4.53 KB
/
vx-table.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vxe-table/lib/style.css">
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
<div id="app" style="padding:48px">
<!-- <vxe-table
border
show-overflow
ref="xTable1"
height="300"
:row-config="{isHover: true}"
:sort-config="{trigger: 'cell'}">
<vxe-column type="seq" width="100"></vxe-column>
<vxe-column field="name" title="Name" sortable></vxe-column>
<vxe-column field="sex" title="Sex"></vxe-column>
<vxe-column field="age" title="Age"></vxe-column>
<vxe-column field="address" title="Address" show-overflow></vxe-column>
</vxe-table> -->
<el-table
:data="tableData"
border
style="width:100%">
<el-table-column
fixed="left"
prop="date"
label="日期"
width="150">
</el-table-column>
<el-table-column
prop="name"
label="姓名"
width="120">
</el-table-column>
<el-table-column
prop="province"
label="省份"
width="120">
</el-table-column>
<el-table-column
prop="city"
label="市区"
width="200">
</el-table-column>
<el-table-column
prop="address"
label="地址"
width="500">
</el-table-column>
<el-table-column
prop="zip"
label="邮编"
width="120">
</el-table-column>
<el-table-column prop="a" label="a列" width="200">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.a" type="date" placeholder="选择日期"></el-date-picker>
</template>
</el-table-column>
<el-table-column prop="b" label="b列" width="200">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.b"></el-input>
</template>
</el-table-column>
<el-table-column prop="c" label="c列" width="200"></el-table-column>
<el-table-column prop="d" label="d列" width="200"></el-table-column>
<el-table-column prop="e" label="e列" width="200"></el-table-column>
<el-table-column prop="f" label="f列" width="200"></el-table-column>
<el-table-column prop="g" label="g列" width="200"></el-table-column>
<el-table-column prop="h" label="h列" width="200"></el-table-column>
<el-table-column prop="i" label="i列" width="200"></el-table-column>
<el-table-column prop="j" label="j列" width="200"></el-table-column>
<el-table-column prop="k" label="k列" width="200"></el-table-column>
<el-table-column prop="l" label="l列" width="200"></el-table-column>
<el-table-column prop="m" label="m列" width="200"></el-table-column>
<el-table-column prop="n" label="n列" width="200"></el-table-column>
<el-table-column
fixed="right"
label="操作"
width="100">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
<el-button type="text" size="small">编辑</el-button>
</template>
</el-table-column>
</el-table>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/xe-utils"></script>
<script src="https://cdn.jsdelivr.net/npm/vxe-table"></script> -->
<!-- <script src="//unpkg.com/vue@2/dist/vue.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/index.js"></script>
<script>
console.time("测试性能")
var Main = {
methods: {
handleClick(row) {
console.log(row);
}
},
mounted(){
for(let i=0;i<500;i++){
this.tableData.push({
date: '2016-05-02',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
zip: 200333,
a:'2021-09-22',
b:2,
c:10000,
d:30000,
e:'dedededefrf',
f:'frfrfdfref343',
g:200000,
h:1,
i:444,
j:43434,
k:'3444',
l:23,
m:'3e32e32e23',
n:'23e3e3e44'
})
}
this.$nextTick(()=>{
console.timeEnd("测试性能")
})
},
data() {
return {
tableData: []
}
}
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')
</script>
</body>
</html>