mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
22 lines
469 B
JavaScript
22 lines
469 B
JavaScript
export default {
|
|
functional: true,
|
|
props: {
|
|
render: {
|
|
type: [String, Number, 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 if (typeof render === 'number') {
|
|
return context._v(String(render))
|
|
} else {
|
|
return null
|
|
}
|
|
}
|
|
}
|