element-plus-nuxt
element-plus-nuxt copied to clipboard
Does El-tabs not support ssr?
It render tab nav in client.
Some components are dynamically generated based on the content of the slots, and may not be fully rendered on the server side(eq. ElTabs), which needs to be optimized
What should I do?
You can try optimizing it and then submit a PR to ElementPlus
Where I can't locate the problem... It's werid, I have no time to do this. :-(
I found it... El-tabs only render in client, because
tabs.tsx
const {
children: panes,
addChild: registerPane,
removeChild: unregisterPane,
} = useOrderedChildren<TabsPaneContext>(getCurrentInstance()!, 'ElTabPane')
tab-pane.vue
onMounted(() => {
tabsRoot.registerPane(pane)
})
onUnmounted(() => {
tabsRoot.unregisterPane(pane.uid)
})
It is indeed here that caused the tab nav not to be fully rendered as a static page on SSR
@tolking And has a props.xx.map also have an impact. These maybe can save you time.
any updates?
any updates?
Unfortunately, no.
This fixed by element-plus v1.8.0