Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

picker组件中的slots的备选数组,不支持动态变换吗? #449

Closed
Jabbar2010 opened this issue Nov 16, 2016 · 5 comments
Closed
Labels

Comments

@Jabbar2010
Copy link

Jabbar2010 commented Nov 16, 2016

image

如图所示,动态设置的values,在change事件中是这个样子。。。

@Leopoldthecoder
Copy link
Contributor

动态改变备选值数组需要使用 setSlotValues 方法。

@Jabbar2010
Copy link
Author

@Leopoldthecoder 你好,按照你说的,那么这个picker对象怎么获取呢?目前我只知道在onDataChange事件中的回调里面有picker对象,我可能需要全局的Picker对象来setSlotValues

@Leopoldthecoder
Copy link
Contributor

<mt-picker ref="picker">
...
</mt-picker>

这样就可以获取到 Picker 实例:

this.$refs.picker.setSlotValues(...)

@Jabbar2010
Copy link
Author

@Leopoldthecoder 非常感谢,可以了~

@roy-yi
Copy link

roy-yi commented Feb 19, 2017

你好,请问,你获取的到的values[0]是不是undefined?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants