Element: select目前只提供change回调,是否能提供select组件里input的@input回调?

Created on 13 Jan 2017  ·  3Comments  ·  Source: ElemeFE/element

现在select 的remote-method 方法只会callback一个value,但有些需求只有一个value是不够的如下
demo
我想输入关键词的时候,根据前面一个select的value,发出remote请求,但现在获取不到当前对象,并不知道是list里的哪一个row.
是否可以暴露select里面input的change事件?或者remote-method回调里面对传一个当前对象?

Most helpful comment

目前解决方案是自己包一个柯里化函数
demo
但还是希望暴露更多的东西,方便使用。

All 3 comments

目前解决方案是自己包一个柯里化函数
demo
但还是希望暴露更多的东西,方便使用。

感觉你的做法是对的,这个场景应该是由用户来区分。

不过关于 remote-method 是否需要更多参数,我后面会再考虑。

直接使用匿名函数是可以的:
:remote-method="(v, i='param')=>{myfun(v, i)}"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhguokai picture zhguokai  ·  3Comments

smallpath picture smallpath  ·  3Comments

gengxuelei picture gengxuelei  ·  3Comments

fscardua picture fscardua  ·  3Comments

yubo111 picture yubo111  ·  3Comments