Element: [Feature Request] switch change event need more params

Created on 30 Jun 2017  ·  1Comment  ·  Source: ElemeFE/element

Existing Component

Yes

Component Name

Switch

Description

How can I do this?
One page has multiple card, and every card has a switch, the cards are genereated by 'v-for' loop. Now I need to recognize which card's switch triggered. I ever use a param to get this but now change event has a fixed param which is new state's bool value. My earlier code is not work any longer.

I try to use @change="switch(new_state, index)" but it does not work...

Most helpful comment

See: https://jsfiddle.net/okkthab6/
Outputs are in the Console.

@change="val => handleChange(val, index)"

>All comments

See: https://jsfiddle.net/okkthab6/
Outputs are in the Console.

@change="val => handleChange(val, index)"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dbskccc picture dbskccc  ·  3Comments

fscardua picture fscardua  ·  3Comments

gengxuelei picture gengxuelei  ·  3Comments

PanJiaChen picture PanJiaChen  ·  3Comments

smallpath picture smallpath  ·  3Comments