mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
20 lines
376 B
JavaScript
20 lines
376 B
JavaScript
export default {
|
|
functional: true,
|
|
props: {
|
|
render: {
|
|
type: [String, Function],
|
|
default: () => {}
|
|
}
|
|
},
|
|
render (h, context) {
|
|
const render = context.props.render
|
|
if (typeof render === 'function') {
|
|
return render(h)
|
|
} else if (typeof render === 'string') {
|
|
return context._v(render)
|
|
} else {
|
|
return null
|
|
}
|
|
}
|
|
}
|