ant-design-vue/components/_util/Clone.vue

20 lines
421 B
Vue
Raw Normal View History

2018-01-08 18:31:04 +08:00
<script>
import { cloneElement } from './vnode'
import PropTypes from './vue-types'
export default {
props: {
childProps: PropTypes.object.def({}),
},
render () {
2018-01-18 18:58:36 +08:00
const { $attrs, $listeners, childProps, $slots } = this
let children = $slots.default[0]
2018-01-08 18:31:04 +08:00
children = cloneElement(children, {
attr: $attrs,
on: $listeners,
props: childProps,
})
return children
},
}
</script>