单击按钮时,我试图加载更多项目。代码返回错误: 未捕获的DOMException:无法对'Document'执行'querySelectorAll':'.moreArticle:hidden'不是有效的选择器。
function Container({ location }) {
return (
<div>
<Switch location={location}>
<Route path="/productsList" component={ProductList} />
<Route path="/customersList" component={CustomersList} />
<Route path="/appointmentsList" component={AppointmentsList} />
<Route exact path="/annotationList" component={AnnotationList} />
<Route path="/annotationList/annView/:id" component={annView} />
<Route path="/addProduct" component={AddProduct} />
</Switch>
</div>
);
}
还有我的javascript:
<div class="articles col-lg-10 offset-lg-2">
<div class="article moreArticle col-lg-5">
<h3>Workshop k tématu spolufinancovaných projektů z ESI fondů</h3>
<p>28/12/2018</p>
</div>
<div class="article moreArticle col-lg-5" style="display: none;">
<h3>Workshop k tématu spolufinancovaných projektů z ESI fondů</h3>
<p>28/12/2018</p>
</div>
<div class="article moreArticle col-lg-5" style="display: none;">
<h3>Workshop k tématu spolufinancovaných projektů z ESI fondů</h3>
<p>28/12/2018</p>
</div>
<div id="loadMore" style="">
<a href="#">Načíst další články</a>
</div>
</div>
我在webpack中使用Cash-dom运行它。知道代码有什么问题吗?