How to pass a dynamic argument to a method in Vue.js?

1

I need to call a v-on event: click with a dynamic argument.

I tried the most logical way:

v-on:click="my_method({{value}})" .

It does not work.

    
asked by anonymous 10.09.2016 / 05:01

1 answer

1

Simply do this:

v-on:click="my_method(value)"

You do not need to use interpolation within dynamic HTML attributes. In VueJS 2 any attempt to interpolate attributes generates an error message.

    
24.09.2016 / 02:52