<script>
import Table from 'element-ui/lib/table'
import 'element-ui/lib/theme-chalk/table.css'
import emptyImg from '../components/imgs/empty.jpg'
const emptyComp = (h, text) => {
const emptyTip = text || '暂无数据'
return h('div', {
slot: 'empty'
}, [
h('img', {
'attrs': {
class: 'empty_img',
src: emptyImg
}
}),
h('div', {
'attrs': {
class: 'empty_span'
}
}, emptyTip)
])
}
export default {
functional: true,
render: function (h, context) {
const childNode = [...context.children, emptyComp(h, context.props.emptyTip)]
return h(Table, context.data, childNode)
}
}
</script>