我有一个显示评论的轮播。单击按钮时,我收到此错误:
TypeError: $$invalidate(...) is not a function
奇怪的是,一切正常,所以没有任何东西被破坏。但我无法理解这个错误来自哪里或导致它的原因。这是代码:
<script>
let showntestimonial = 1;
const testimonials = [ { // array of objects } ];
</script>
<section class="customer-testimonial">
<button
class="arrowbox"
on:click={() => (showntestimonial += 2)((showntestimonial = showntestimonial % 3))}>
<i class="far fa-chevron-left" />
</button>
<div class="textbox">
<p>
{@html testimonials[showntestimonial].text[$language]}
</p>
<h2>
{@html testimonials[showntestimonial].name}
</h2>
</div>
<button
class="arrowbox"
on:click={() => (showntestimonial++)((showntestimonial = showntestimonial % 3))}>
<i class="far fa-chevron-right" />
</button>
</section>