Vue-material: In the <md-input> key modifier (v-on:keyup.enter) not working

Created on 5 Jan 2017  路  2Comments  路  Source: vuematerial/vue-material

Hi,

In the element is the key modifier (v-on:keyup.enter) not working. I tried to add a input with the key modifier inside the , but i didn't help.

Thanks for your help and your great layout.

question

Most helpful comment

You just need to use the native modifier:

https://codepen.io/korylprince/pen/QdwoNr

This is not easily found... I wish the main Vue event docs talked about this...

All 2 comments

You just need to use the native modifier:

https://codepen.io/korylprince/pen/QdwoNr

This is not easily found... I wish the main Vue event docs talked about this...

With the native modifier it's working. Now I do it like this:

 <md-input placeholder="Name" @keyup.native="add(value, $event)"></md-input>

  methods: {
      add: function(value, event){
            if (event.key === 'Enter')
            {
               //AddSomeThing
            }
          },
  }

Many thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

korylprince picture korylprince  路  3Comments

lee-frank picture lee-frank  路  3Comments

Leshgan picture Leshgan  路  3Comments

sandhose picture sandhose  路  3Comments

capttrousers picture capttrousers  路  3Comments