You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/vc-trigger/LazyRenderBox.jsx

28 lines
668 B

import { Text } from 'vue';
import PropTypes from '../_util/vue-types';
import { getSlot } from '../_util/props-util';
7 years ago
export default {
name: 'LazyRenderBox',
7 years ago
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>;
7 years ago
}
return child && child[0];
7 years ago
},
};