mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
18 lines
403 B
JavaScript
18 lines
403 B
JavaScript
import { i18n } from './composables'
|
|
|
|
export default {
|
|
setup () {
|
|
return {
|
|
...i18n()
|
|
}
|
|
},
|
|
render () {
|
|
const { locale } = this
|
|
const defaultSlot = (this.$slots.default && this.$slots.default()) || []
|
|
const index = defaultSlot.findIndex((VNode) => VNode.type.name === locale)
|
|
if (~index) {
|
|
return defaultSlot[index]
|
|
} else return defaultSlot[0] || null
|
|
}
|
|
}
|