Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does El-tabs not support ssr? #78

Open
OnlyWick opened this issue Dec 7, 2023 · 9 comments
Open

Does El-tabs not support ssr? #78

OnlyWick opened this issue Dec 7, 2023 · 9 comments

Comments

@OnlyWick
Copy link

OnlyWick commented Dec 7, 2023

It render tab nav in client.

Dec-06-2023 22-59-41

@tolking
Copy link
Member

tolking commented Dec 8, 2023

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

@OnlyWick
Copy link
Author

OnlyWick commented Dec 8, 2023 via email

@tolking
Copy link
Member

tolking commented Dec 8, 2023

You can try optimizing it and then submit a PR to ElementPlus

@OnlyWick
Copy link
Author

OnlyWick commented Dec 8, 2023

Where I can't locate the problem... It's werid, I have no time to do this. :-(

@OnlyWick
Copy link
Author

OnlyWick commented Dec 8, 2023

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)
})

@tolking
Copy link
Member

tolking commented Dec 15, 2023

It is indeed here that caused the tab nav not to be fully rendered as a static page on SSR

@OnlyWick
Copy link
Author

@tolking And has a props.xx.map also have an impact. These maybe can save you time.

@KonstaVadim
Copy link

any updates?

@OnlyWick
Copy link
Author

any updates?

Unfortunately, no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants