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

20 lines
404 B
React
Raw Normal View History

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