Skip to content

Broken v-on inside component #863

@yemi

Description

@yemi

This used to work but after upgrading a few versions it doesn't work anymore and i cant figure out why.

<div v-component="card">
    <button v-on="click:clicked($event)">Click me 1</button>
    <button v-on="click:clicked">Click me 2</button>
</div>

My code generates 2 errors depending on how i call the function inside v-on.

v-on="click:clicked($event)" generates Uncaught TypeError: scope.clicked is not a function
and
v-on="click:clicked" generates [Vue warn]: Directive "v-on:clicked" expects a function value.

I would like to pass the event object to the method.

Heres the fiddle: http://jsfiddle.net/ypsscvy5/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions