We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
class Test extends Taro.Component{ state={ val:999 } render(){ return <View>{this.props.val}</View> } }
模拟器上显示为999
如果把Test的val改成val2就显示正常
state = { val2:999 }
The text was updated successfully, but these errors were encountered:
的确有这个问题,由于我们是自己做的组件化方案,不管 props 还是 state都会打入到小程序 Page的 data 中。我们暂时准备做一个 ESLint 规则,先提示开发者不要这么写。
props
state
Page
data
前些日子微信小程序更新了新的能力,我们应该会基于微信小程序的组件化重构 Taro 的组件化方案。到时这个问题应该就不存在了。很多限制也不会存在(例如在自定义组件里写 this.props.children,通过 props 传递 JSX)。
this.props.children
Sorry, something went wrong.
现在能用一样的名字不?
0383991
貌似官网都没相关信息
eslint 和编译应该都会报错的的
No branches or pull requests
模拟器上显示为999
如果把Test的val改成val2就显示正常
The text was updated successfully, but these errors were encountered: