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

不支持传递函数? #367

Closed
LuckySinvy opened this issue Jul 23, 2018 · 2 comments
Closed

不支持传递函数? #367

LuckySinvy opened this issue Jul 23, 2018 · 2 comments

Comments

@LuckySinvy
Copy link

rt

@luckyadam
Copy link
Member

代码贴出来看看哦

@xiaoyuze88
Copy link
Contributor

xiaoyuze88 commented Jun 14, 2019

image
image
image

不太确定这里面的实现逻辑,如图,按该方式传递函数在原生小程序内是可以传过去的,但是taro中只有 test1 中的形式可以传递过去。其他是被 shakeFnFromObject 函数过滤掉了,test1 不知道为啥能够传递。

我们的场景是需要传递 function 类型的 validator 进去 form 组件,不知道能否按照原生小程序支持的特性来实现?

不是传递事件回调,而是复杂数据结构中包含有 function,比如:

const formConfig = [
    {  
         name: 'name',
         rules: [
                  { validator: val => !!val }
         ]
    }
]

@luckyadam

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

No branches or pull requests

3 participants