nuxt3使用@ant-design-vue/nuxt在SSR渲染下,从一个一面点击NuxtLink跳转到另一个页面后,页面上的Rate组件的星星不显示,但是在这个页面点击刷新后才显示出星星。
<div style="align-self: flex-start;">
<a-rate style="color: #FF9100;" :value="star" disabled />
</div>
代码很简单,也没有报错,看不显示的html是缺少了ant-rate-star-second
下的svg,这是为什么?
<ul
class="ant-rate ant-rate-disabled css-dev-only-do-not-override-vyccq1"
tabindex="-1"
role="radiogroup"
style="color: rgb(255, 145, 0)"
>
<li class="ant-rate-star ant-rate-star-full">
<div
role="radio"
aria-checked="true"
aria-posinset="1"
aria-setsize="5"
tabindex="-1"
>
<div class="ant-rate-star-first">
<span role="img" aria-label="star" class="anticon anticon-star"
><svg
focusable="false"
data-icon="star"
width="1em"
height="1em"
fill="currentColor"
aria-hidden="true"
viewBox="64 64 896 896"
>
<path
d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"
></path></svg
><!----></span
>
</div>
<div class="ant-rate-star-second"></div>
</div>
</li>
<li class="ant-rate-star ant-rate-star-full">
<div
role="radio"
aria-checked="true"
aria-posinset="2"
aria-setsize="5"
tabindex="-1"
>
<div class="ant-rate-star-first">
<span role="img" aria-label="star" class="anticon anticon-star"
><svg
focusable="false"
data-icon="star"
width="1em"
height="1em"
fill="currentColor"
aria-hidden="true"
viewBox="64 64 896 896"
>
<path
d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"
></path></svg
><!----></span
>
</div>
<div class="ant-rate-star-second"></div>
</div>
</li>
<li class="ant-rate-star ant-rate-star-full">
<div
role="radio"
aria-checked="true"
aria-posinset="3"
aria-setsize="5"
tabindex="-1"
>
<div class="ant-rate-star-first">
<span role="img" aria-label="star" class="anticon anticon-star"
><svg
focusable="false"
data-icon="star"
width="1em"
height="1em"
fill="currentColor"
aria-hidden="true"
viewBox="64 64 896 896"
>
<path
d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"
></path></svg
><!----></span
>
</div>
<div class="ant-rate-star-second"></div>
</div>
</li>
<li class="ant-rate-star ant-rate-star-full">
<div
role="radio"
aria-checked="true"
aria-posinset="4"
aria-setsize="5"
tabindex="-1"
>
<div class="ant-rate-star-first">
<span role="img" aria-label="star" class="anticon anticon-star"
><svg
focusable="false"
data-icon="star"
width="1em"
height="1em"
fill="currentColor"
aria-hidden="true"
viewBox="64 64 896 896"
>
<path
d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"
></path></svg
><!----></span
>
</div>
<div class="ant-rate-star-second"></div>
</div>
</li>
<li class="ant-rate-star ant-rate-star-full">
<div
role="radio"
aria-checked="true"
aria-posinset="5"
aria-setsize="5"
tabindex="-1"
>
<div class="ant-rate-star-first">
<span role="img" aria-label="star" class="anticon anticon-star"
><svg
focusable="false"
data-icon="star"
width="1em"
height="1em"
fill="currentColor"
aria-hidden="true"
viewBox="64 64 896 896"
>
<path
d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"
></path></svg
><!----></span
>
</div>
<div class="ant-rate-star-second"></div>
</div>
</li>
</ul>
关闭SSR渲染就显示
关闭SSR就显示,在SSR下使用<ClientOnly>
标签包裹也不显示