ant-design-vue/components/trigger/LazyRenderBox.vue
tangjinzhou 63ff2f83aa trigger
2017-12-27 16:13:26 +08:00

29 lines
567 B
Vue

<script>
import PropTypes from '../_util/vue-types'
export default {
props: {
visible: PropTypes.bool,
hiddenClassName: PropTypes.string,
},
render () {
const { hiddenClassName, visible } = this.$props
if (hiddenClassName || !this.$slots.default || this.$slots.default.length > 1) {
let cls = ''
if (!visible && hiddenClassName) {
cls += ` ${hiddenClassName}`
}
return (
<div class={cls}>
{this.$slots.default}
</div>
)
}
return this.$slots.default[0]
},
}
</script>