mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-05 05:29:01 +08:00
28 lines
668 B
Vue
28 lines
668 B
Vue
import { Text } from 'vue';
|
|
import PropTypes from '../_util/vue-types';
|
|
import { getSlot } from '../_util/props-util';
|
|
|
|
export default {
|
|
name: 'LazyRenderBox',
|
|
props: {
|
|
visible: PropTypes.bool,
|
|
hiddenClassName: PropTypes.string,
|
|
},
|
|
render() {
|
|
const { hiddenClassName } = this.$props;
|
|
const child = getSlot(this);
|
|
if (
|
|
hiddenClassName ||
|
|
(child && child.length > 1) ||
|
|
(child && child[0] && child[0].type === Text)
|
|
) {
|
|
// const cls = '';
|
|
// if (!visible && hiddenClassName) {
|
|
// // cls += ` ${hiddenClassName}`
|
|
// }
|
|
return <div>{child}</div>;
|
|
}
|
|
return child && child[0];
|
|
},
|
|
};
|