The issue was I was trying to call a function on the parent directly from the child and that doesn't work. You need to create a custom event on the child that the parent is listening for like this:
Parent HTML
<c-flow-carousel-component items={items} options={options} onslideclicked={handleSlideClicked}></c-flow-carousel-component>
Parent JS
handleSlideClicked(event) {
console.log('in parent handle click' + event.detail);
}
Child HTML
<div class="slds-carousel__image" data-index={component.index} onclick={handleSlideClick}>
Child JS
@api slideIndex;
handleSlideClick(event) {
this.slideIndex = event.currentTarget.dataset.index;
// Creates the event with the data.
const selectedEvent = new CustomEvent("slideclicked", {
detail: this.slideIndex, bubbles:true
});
// Dispatches the event.
this.dispatchEvent(selectedEvent);
}
Thanks to Sanket Kumar's blog : https://salesforcediaries.com/2019/08/07/lwc-communication-part-2-passing-data-from-child-to-parent-in-lwc/