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

fix(taro-components): fix richText component #2131

Merged
merged 1 commit into from
Feb 14, 2019

Conversation

pamler
Copy link
Contributor

@pamler pamler commented Feb 11, 2019

主要修改了两个地方:

  1. RichText这个组件,nodes的type如果不是text的话,children这个属性在微信小程序的doc里是可选的,所以item.children就可能为undefined,所以加个默认值空数组。
  2. 对于有些node类型,例如image,它的attrs不仅仅限于class和style,还有src、width、height等。由于情况比较多,所以这块建议直接把这些属性拿过来,统统赋给props

主要修改了两个地方:
1. RichText这个组件,nodes的type如果不是text的话,children这个属性在微信小程序的doc里是可选的,所以item.children就可能为undefined,所以加个默认值空数组。
2. 对于有些node类型,例如image,它的attrs不仅仅限于class和style,还有src、width、height等。由于情况比较多,所以这块建议直接把这些属性拿过来,统统赋给props
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

Successfully merging this pull request may close these issues.

2 participants