Closed enzonotario closed 2 days ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
vitepress-theme-openapi | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 5, 2024 11:09pm |
The changes involve wrapping the OATryWithVariables
component in a ClientOnly
component within the try-it
slot template of src/components/Common/OAOperation.vue
. This adjustment ensures that the OATryWithVariables
component is rendered exclusively on the client side, accommodating components that rely on browser-specific features. No other modifications were made to the component's structure, logic, or control flow.
File Path | Change Summary |
---|---|
src/components/Common/OAOperation.vue | Added a ClientOnly wrapper around the OATryWithVariables component in the try-it slot template. |
src/components/Common/OAOperation.vue (1)
`269-280`: **LGTM! Wrapping OATryWithVariables with ClientOnly prevents SSR issues.** The addition of the `ClientOnly` wrapper around the `OATryWithVariables` component is a good solution to prevent server-side rendering (SSR) of client-only code. This change aligns perfectly with the PR objective and should resolve the SSR-related issues mentioned in the related issue #65. Some benefits of this change: 1. It ensures that the "Try" section is only rendered on the client-side, avoiding potential SSR compatibility problems. 2. It doesn't affect the functionality or props of the `OATryWithVariables` component. 3. The implementation is clean and follows Vue best practices for handling client-only components.
pnpm add https://pkg.pr.new/vitepress-theme-openapi@67
pnpm add https://pkg.pr.new/vitepress-theme-openapi@67
commit: 8dd4bc6
Description
Wraps Try section in
ClientOnly
to avoid SSR, since it includes client-only code.Related issues/external references
Fixes #65
Types of changes