Table support real Render function to render Cell
This commit is contained in:
parent
687c4562f1
commit
87b6ef9d8b
2 changed files with 75 additions and 37 deletions
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<Table border :context="self" :columns="columns7" :data="data6"></Table>
|
||||
<abc></abc>
|
||||
<Table border :columns="columns7" :data="data6"></Table>
|
||||
<Button @click="handleAdd"> + 1</Button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -10,13 +10,23 @@
|
|||
components: { abc },
|
||||
data () {
|
||||
return {
|
||||
self: this,
|
||||
data1: 1,
|
||||
// self: this,
|
||||
columns7: [
|
||||
{
|
||||
title: '姓名',
|
||||
key: 'name',
|
||||
render (row, column, index) {
|
||||
return `<abc></abc>`;
|
||||
// render (row, column, index) {
|
||||
// return `<abc></abc>`;
|
||||
// }
|
||||
render: (h, row, column, index) => {
|
||||
return h('div', [
|
||||
h('Button',{
|
||||
on: {
|
||||
click: this.handleClick
|
||||
}
|
||||
}, 'hello')
|
||||
])
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -61,6 +71,11 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
ttt () {
|
||||
return this.data1 + 1;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show (index) {
|
||||
this.$Modal.info({
|
||||
|
@ -70,6 +85,12 @@
|
|||
},
|
||||
remove (index) {
|
||||
this.data6.splice(index, 1);
|
||||
},
|
||||
handleAdd () {
|
||||
this.data1++;
|
||||
},
|
||||
handleClick () {
|
||||
this.$Message.info('111')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue