ant-design-vue/components/vc-trigger/LazyRenderBox.jsx

23 lines
591 B
Vue
Raw Normal View History

2019-01-12 03:33:27 +00:00
import PropTypes from '../_util/vue-types';
2017-12-22 10:43:28 +00:00
export default {
2020-06-10 10:20:57 +00:00
name: 'LazyRenderBox',
inheritAttrs: false,
2017-12-22 10:43:28 +00:00
props: {
visible: PropTypes.bool,
hiddenClassName: PropTypes.string,
},
2019-01-12 03:33:27 +00:00
render() {
2020-06-10 10:20:57 +00:00
const { hiddenClassName } = this.$props;
2020-06-09 10:30:18 +00:00
const child = this.$slots.default && this.$slots.default();
if (hiddenClassName || (child && child.length > 1)) {
2020-06-10 10:20:57 +00:00
// const cls = '';
// if (!visible && hiddenClassName) {
// // cls += ` ${hiddenClassName}`
// }
return <div {...this.$attrs}>{child}</div>;
2017-12-22 10:43:28 +00:00
}
2020-06-10 10:20:57 +00:00
return child && child[0];
2017-12-22 10:43:28 +00:00
},
2019-01-12 03:33:27 +00:00
};