Skip to main content

Multiple Alpine Components on Page: Events and Parameters

Premium
3:21

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

alin avatar

Hi!

I have a simple(i think) question. If i change the event name to camelCase, so to cartChanged, instead of cart-changed, it stops working. Is this normal behavior?

Modestas avatar

Hi, the events on alpinejs end should be a kebab-caes and contain only lowercase letters. In general, I personally use kebab-case for all front-end facing events :)

alin avatar

Thank you, Modestas!