import { defineVxeComponent } from '../../ui/src/comp'; import XEUtils from 'xe-utils'; import { getI18n, getIcon, createEvent } from '../../ui'; export default { name: 'VxeEmpty', props: { imageUrl: String, imageStyle: Object, icon: String, status: String, content: [String, Number] }, data() { const xID = XEUtils.uniqueId(); const reactData = {}; return { xID, reactData }; }, methods: { // // Method // dispatchEvent(type, params, evnt) { const $xeEmpty = this; $xeEmpty.$emit(type, createEvent(evnt, { $empty: $xeEmpty }, params)); }, // // Render // renderVN(h) { const $xeEmpty = this; const props = $xeEmpty; const { imageUrl, imageStyle, icon, status, content } = props; return h('div', { ref: 'refElem', class: ['vxe-empty', { [`theme--${status}`]: status }] }, [ h('div', { class: 'vxe-empty--inner' }, [ imageUrl ? h('div', { class: 'vxe-empty--img-wrapper' }, [ h('img', { attrs: { src: imageUrl }, style: imageStyle }) ]) : h('div', { class: 'vxe-empty--icon-wrapper' }, [ h('i', { class: icon || getIcon().EMPTY_DEFAULT }) ]), h('div', { class: 'vxe-empty--content-wrapper' }, `${content || getI18n('vxe.empty.defText')}`) ]) ]); } }, render(h) { return this.renderVN(h); } };