2cb8a6d9
梁灏
commit Table comp...
|
1
|
<template>
|
67c9b1c8
梁灏
fixed #591
|
2
|
<div>
|
87b6ef9d
梁灏
Table support rea...
|
3
4
|
<Table border :columns="columns7" :data="data6"></Table>
<Button @click="handleAdd"> + 1</Button>
|
67c9b1c8
梁灏
fixed #591
|
5
|
</div>
|
2cb8a6d9
梁灏
commit Table comp...
|
6
7
|
</template>
<script>
|
64f99c05
梁灏
Table support ren...
|
8
|
import abc from '../components/test.vue';
|
2cb8a6d9
梁灏
commit Table comp...
|
9
|
export default {
|
64f99c05
梁灏
Table support ren...
|
10
|
components: { abc },
|
2cb8a6d9
梁灏
commit Table comp...
|
11
12
|
data () {
return {
|
87b6ef9d
梁灏
Table support rea...
|
13
14
|
data1: 1,
// self: this,
|
64f99c05
梁灏
Table support ren...
|
15
|
columns7: [
|
2404849c
leonine
合并原作者更新
|
16
|
{
|
7409cb3c
梁灏
fixed #549
|
17
|
title: '姓名',
|
64f99c05
梁灏
Table support ren...
|
18
|
key: 'name',
|
87b6ef9d
梁灏
Table support rea...
|
19
20
21
22
23
24
25
26
27
28
29
|
// render (row, column, index) {
// return `<abc></abc>`;
// }
render: (h, row, column, index) => {
return h('div', [
h('Button',{
on: {
click: this.handleClick
}
}, 'hello')
])
|
64f99c05
梁灏
Table support ren...
|
30
|
}
|
b89a982e
梁灏
fixed #205
|
31
32
|
},
{
|
7409cb3c
梁灏
fixed #549
|
33
|
title: '年龄',
|
64f99c05
梁灏
Table support ren...
|
34
|
key: 'age'
|
99d0429e
梁灏
update Button & T...
|
35
36
|
},
{
|
7409cb3c
梁灏
fixed #549
|
37
38
|
title: '地址',
key: 'address'
|
67c9b1c8
梁灏
fixed #591
|
39
40
|
},
{
|
64f99c05
梁灏
Table support ren...
|
41
42
43
44
45
46
47
48
49
50
|
title: '操作',
key: 'action',
width: 150,
align: 'center',
render (row, column, index) {
return `<i-button type="primary" size="small" @click="show(${index})">查看</i-button> <i-button type="error" size="small" @click="remove(${index})">删除</i-button>`;
}
}
],
data6: [
|
7409cb3c
梁灏
fixed #549
|
51
52
53
54
|
{
name: '王小明',
age: 18,
address: '北京市朝阳区芍药居'
|
3c38e4f7
梁灏
update Table cell
|
55
|
},
|
891f61d8
梁灏
fixed #577
|
56
|
{
|
7409cb3c
梁灏
fixed #549
|
57
58
59
|
name: '张小刚',
age: 25,
address: '北京市海淀区西二旗'
|
891f61d8
梁灏
fixed #577
|
60
61
|
},
{
|
7409cb3c
梁灏
fixed #549
|
62
63
64
|
name: '李小红',
age: 30,
address: '上海市浦东新区世纪大道'
|
891f61d8
梁灏
fixed #577
|
65
66
|
},
{
|
7409cb3c
梁灏
fixed #549
|
67
68
69
|
name: '周小伟',
age: 26,
address: '深圳市南山区深南大道'
|
891f61d8
梁灏
fixed #577
|
70
|
}
|
d16dce64
梁灏
fixed #193
|
71
|
]
|
2cb8a6d9
梁灏
commit Table comp...
|
72
|
}
|
12bcf7bd
H
添加 remoteFilter方法...
|
73
|
},
|
87b6ef9d
梁灏
Table support rea...
|
74
75
76
77
78
|
computed: {
ttt () {
return this.data1 + 1;
}
},
|
64f99c05
梁灏
Table support ren...
|
79
80
81
82
83
84
85
86
87
|
methods: {
show (index) {
this.$Modal.info({
title: '用户信息',
content: `姓名:${this.data6[index].name}<br>年龄:${this.data6[index].age}<br>地址:${this.data6[index].address}`
})
},
remove (index) {
this.data6.splice(index, 1);
|
87b6ef9d
梁灏
Table support rea...
|
88
89
90
91
92
93
|
},
handleAdd () {
this.data1++;
},
handleClick () {
this.$Message.info('111')
|
12bcf7bd
H
添加 remoteFilter方法...
|
94
|
}
|
2cb8a6d9
梁灏
commit Table comp...
|
95
96
|
}
}
|
d0e206c5
梁灏
Table add content...
|
97
|
</script>
|