Skip to content

Can't listen to events when injecting component in non-vue project #17

@JudahDoupe

Description

@JudahDoupe

When using Vue as a library injected into another project, we are unable to catch the events due to naming. We get a "Vue Tip" warning in the console which keeps us from being able to catch the event.

[Vue tip]: Event "dateselected" is emitted in component at App.vue but the handler is registered for "dateSelected". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "date-selected" instead of "dateSelected".

Changing the event name from "dateSelected" to "date-selected" fixed the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions