Skip to content

Commit

Permalink
fix(plugin-comment): wrap waline with ClientOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 15, 2025
1 parent 6584a90 commit fa70272
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 34 deletions.
2 changes: 1 addition & 1 deletion plugins/blog/plugin-comment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"vue": "^3.5.13"
},
"peerDependencies": {
"@waline/client": "^3.4.3",
"@waline/client": "^3.5.0",
"artalk": "^2.9.0",
"twikoo": "^1.6.39",
"vuepress": "2.0.0-rc.19"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
nextTick,
onMounted,
} from 'vue'
import { usePageFrontmatter, usePageLang } from 'vuepress/client'
import { ClientOnly, usePageFrontmatter, usePageLang } from 'vuepress/client'
import type {
CommentPluginFrontmatter,
WalineLocaleData,
Expand Down Expand Up @@ -104,15 +104,15 @@ export default defineComponent({
{ id: 'comment', class: 'waline-wrapper' },
h(
defineAsyncComponent({
loader: async () =>
(
await import(
/* webpackChunkName: "waline" */ '@waline/client/component'
)
).Waline,
loader: async () => {
const { Waline } = await import(
/* webpackChunkName: "waline" */ '@waline/client/component'
)

return () => h(ClientOnly, () => h(Waline, walineProps.value))
},
loadingComponent: LoadingIcon,
}),
walineProps.value,
),
)
: null
Expand Down
30 changes: 5 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fa70272

Please sign in to comment.