mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-16 01:41:15 +08:00
35 lines
892 B
Vue
35 lines
892 B
Vue
import PropTypes from '../_util/vue-types';
|
|
import Empty from '../empty';
|
|
import emptyImg from './empty.svg';
|
|
|
|
const renderEmpty = {
|
|
functional: true,
|
|
inject: ['configProvider'],
|
|
props: {
|
|
componentName: PropTypes.string,
|
|
},
|
|
render(createElement, context) {
|
|
const { props, injections } = context;
|
|
function renderHtml(componentName) {
|
|
const prefix = injections.configProvider.getPrefixCls('empty');
|
|
switch (componentName) {
|
|
case 'Table':
|
|
case 'List':
|
|
return <Empty image={emptyImg} className={`${prefix}-normal`} />;
|
|
|
|
case 'Select':
|
|
case 'TreeSelect':
|
|
case 'Cascader':
|
|
case 'Transfer':
|
|
return <Empty image={emptyImg} className={`${prefix}-small`} />;
|
|
|
|
default:
|
|
return <Empty />;
|
|
}
|
|
}
|
|
return renderHtml(props.componentName);
|
|
},
|
|
};
|
|
|
|
export default renderEmpty;
|