英文:
Hydration children mismatch in <div>: server rendered element contains fewer child nodes than client vdom
问题
以下是您提供的内容的中文翻译:
在<div>中的水合子不匹配:服务器渲染的元素包含的子节点比客户端虚拟DOM少。
在<div>中的水合子不匹配:服务器渲染的元素包含的子节点比客户端虚拟DOM少。
在Slick内部使用Nuxt链接时无法工作
这是在没有Slick的情况下重复的内容。
我搜索了很多。
问题是什么?
我将其用作组件
Nuxt3
<div class="products-tabs">
<!-- 选项卡 -->
<div id="tab1" class="tab-pane active">
<div class="products-slick" data-nav="#slick-nav-1">
<!-- 产品 -->
<div class="product">
<div class="product-img">
<img src="/img/product01.png" alt="">
<div class="product-label">
<span class="sale">-30%</span>
<span class="new">新款</span>
</div>
</div>
<div class="product-body">
<p class="product-category">分类</p>
<h3 class="product-name"><router-link to="product">产品</router-link></h3>
<h4 class="product-price">$980.00 <del class="product-old-price">$990.00</del></h4>
<div class="product-rating">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
</div>
<div class="product-btns">
<button class="add-to-wishlist"><i class="fa fa-heart-o"></i><span class="tooltipp">添加到
愿望清单</span></button>
<button class="add-to-compare"><i class="fa fa-exchange"></i><span class="tooltipp">添加到
比较</span></button>
<button class="quick-view"><i class="fa fa-eye"></i><span class="tooltipp">快速
查看</span></button>
</div>
</div>
<div class="add-to-cart">
<button class="add-to-cart-btn"><i class="fa fa-shopping-cart"></i> 添加到购物车</button>
</div>
</div>
<!-- /产品 -->
</div>
</div>
</div>
英文:
Hydration children mismatch in <div>: server rendered element contains fewer child nodes than client vdom..
Hydration children mismatch in <div>: server rendered element contains fewer child nodes than client vdom..
Nuxt Link Not Working When Use It Within Slick
Its duplicate this content without slick..
I searched alot..
What's the problem..
I use it as a Component
Nuxt3
<div class="products-tabs">
<!-- tab -->
<div id="tab1" class="tab-pane active">
<div class="products-slick" data-nav="#slick-nav-1">
<!-- product -->
<div class="product">
<div class="product-img">
<img src="/img/product01.png" alt="">
<div class="product-label">
<span class="sale">-30%</span>
<span class="new">NEW</span>
</div>
</div>
<div class="product-body">
<p class="product-category">Category</p>
<h3 class="product-name"><router-link to="product">Product</router-link></h3>
<h4 class="product-price">$980.00 <del class="product-old-price">$990.00</del></h4>
<div class="product-rating">
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
<i class="fa fa-star"></i>
</div>
<div class="product-btns">
<button class="add-to-wishlist"><i class="fa fa-heart-o"></i><span class="tooltipp">add to
wishlist</span></button>
<button class="add-to-compare"><i class="fa fa-exchange"></i><span class="tooltipp">add to
compare</span></button>
<button class="quick-view"><i class="fa fa-eye"></i><span class="tooltipp">quick
view</span></button>
</div>
</div>
<div class="add-to-cart">
<button class="add-to-cart-btn"><i class="fa fa-shopping-cart"></i> add to cart</button>
</div>
</div>
<!-- /product -->
</div>
</div>
</div>
答案1
得分: 1
我通过注释掉空组件来解决了这个问题。
以及它被调用的地方。
答案2
得分: 1
水合子节点不匹配错误主要是由于服务器渲染的HTML与客户端虚拟DOM(Vue组件)之间不匹配引起的。服务器元素中的子节点数量与客户端不同。请检查Vue组件结构。
英文:
Hydration children mismatch error is mainly due to mismatch between the server-rendered HTML and the client-side virtual DOM (Vue components). The number of child nodes in the server element is different from the client-side. Check the the Vue component structure.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论