-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
自定义表单控件无效 #4128
Labels
question
Further information is requested
Comments
@zzzzyp 的确,没有显式使用到的 state 或 props 不会被加入到小程序的 data 中: taro/packages/taro-weapp/src/lifecycle.js Lines 154 to 174 in b8c29c6
这个 behavior 我感觉是给组件定义了 name 和 value 的 properties,但并没有在 Taro 组件里显式声明或使用。因此建议写上 defaultProps 绕过。 |
Hello~ 您的问题楼上已经有了确切的回答,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。 如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。 Good luck and happy coding~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
自定义的表单控件,加了static behaviors = ['wx://form-field'],在form里获取不到它的值
复现步骤
[复现问题的步骤]
期望行为
打印的值应为{ test: "" }
报错信息
实际打印值为{}
系统信息
补充信息
复现的时候发现只要在自定义的组件中引用一下props.name,就可以拿到值了:(
The text was updated successfully, but these errors were encountered: