Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 85b520c

Browse files
authored
fix: ssr hydration error on excerpt summary (fix #89) (#94)
1 parent 9bbdf87 commit 85b520c

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

global-components/BaseListLayout.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
<header class="ui-post-title" itemprop="name headline">
1515
<NavLink :link="page.path">{{ page.title }}</NavLink>
1616
</header>
17-
<!-- eslint-disable vue/no-v-html -->
18-
<p
19-
v-if="page.excerpt"
20-
class="ui-post-summary"
21-
itemprop="description"
22-
v-html="page.excerpt"
23-
/>
24-
<!-- eslint-enable vue/no-v-html -->
17+
18+
<client-only v-if="page.excerpt">
19+
<!-- eslint-disable vue/no-v-html -->
20+
<p
21+
class="ui-post-summary"
22+
itemprop="description"
23+
v-html="page.excerpt"
24+
/>
25+
<!-- eslint-enable vue/no-v-html -->
26+
</client-only>
2527
<p v-else class="ui-post-summary" itemprop="description">
2628
{{ page.frontmatter.summary || page.summary }}
2729
</p>

0 commit comments

Comments
 (0)