Skip to content

Commit fa70272

Browse files
committedJan 15, 2025·
fix(plugin-comment): wrap waline with ClientOnly
1 parent 6584a90 commit fa70272

File tree

3 files changed

+14
-34
lines changed

3 files changed

+14
-34
lines changed
 

‎plugins/blog/plugin-comment/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"vue": "^3.5.13"
5454
},
5555
"peerDependencies": {
56-
"@waline/client": "^3.4.3",
56+
"@waline/client": "^3.5.0",
5757
"artalk": "^2.9.0",
5858
"twikoo": "^1.6.39",
5959
"vuepress": "2.0.0-rc.19"

‎plugins/blog/plugin-comment/src/client/components/WalineComment.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
nextTick,
1212
onMounted,
1313
} from 'vue'
14-
import { usePageFrontmatter, usePageLang } from 'vuepress/client'
14+
import { ClientOnly, usePageFrontmatter, usePageLang } from 'vuepress/client'
1515
import type {
1616
CommentPluginFrontmatter,
1717
WalineLocaleData,
@@ -104,15 +104,15 @@ export default defineComponent({
104104
{ id: 'comment', class: 'waline-wrapper' },
105105
h(
106106
defineAsyncComponent({
107-
loader: async () =>
108-
(
109-
await import(
110-
/* webpackChunkName: "waline" */ '@waline/client/component'
111-
)
112-
).Waline,
107+
loader: async () => {
108+
const { Waline } = await import(
109+
/* webpackChunkName: "waline" */ '@waline/client/component'
110+
)
111+
112+
return () => h(ClientOnly, () => h(Waline, walineProps.value))
113+
},
113114
loadingComponent: LoadingIcon,
114115
}),
115-
walineProps.value,
116116
),
117117
)
118118
: null

‎pnpm-lock.yaml

+5-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.