//效果图是这样的
// 代码render方法如下
<template>
<table border :columns="columns" :data="data"></table>
</template>
<script>
export default {
data () {
return {
columns: [
{title: '年龄',key: 'age'},
{title: '地址', key: 'address'},
{title: '操作',key: 'action'}
{title: '户口',
width: 200,
align: 'center',
render: (h, row) => {
return h('div',[
// consolg.log(row) 拿到row你要展示在按钮上面的字段
h('div', row.row.address),
h('Button', {
props: {type: 'primary'},
style: {marginRight: '3px'},
on: {
click: (e) => {
console.log('点击按钮事件')
}
}
}, '账单信息'),
h('Button', {
props: {type: 'primary'},
on: {
click: (e) => {
console.log('点击按钮事件')
}
}
}, '缴款信息'),
])
}
}
],
data: [
{name: '围护', age: 18, address: '深圳福田'},
{name: '估计',age: 25,address: '湖北崇阳'}
]
}
},
methods: {
}
}
</script>