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

29 lines
534 B
Vue
Raw Normal View History

2017-12-22 18:43:28 +08:00
<script>
import PropTypes from 'vue-types'
export default {
props: {
visible: PropTypes.bool,
hiddenClassName: PropTypes.string,
},
render () {
2017-12-25 18:08:36 +08:00
const { hiddenClassName, visible } = this.$props
2017-12-22 18:43:28 +08:00
if (hiddenClassName || 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>