Skip to content

v-on click and keyup #1250

@mocheaz

Description

@mocheaz

I have a gallery with "next" and "previous" buttons.

Here what i have now

<a href="#" v-on="click: previous">Previous</a>
<a href="#" v-on="click: next">Next</a>

I want them to work with 2 options.

  1. Clicking on the link.
  2. Clicking on left/right arrows on keyboard.

I tried

<a href="#" v-on="click: previous, keyup: previous | key 'left' ">Previous</a>
<a href="#" v-on="click: next, keyup: next | key 'right' ">Next</a>

But this didn't work.

Is this possible with vue.js?

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