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:修复宽高改变的情况 #1507

Merged
merged 1 commit into from
Jun 9, 2022
Merged

fix:修复宽高改变的情况 #1507

merged 1 commit into from
Jun 9, 2022

Conversation

tangying1027
Copy link
Contributor

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Description of change

@tangying1027 tangying1027 requested a review from zengyue June 7, 2022 12:22
@zengyue
Copy link
Member

zengyue commented Jun 7, 2022

@@ -147,10 +147,39 @@ class Canvas extends Component<ChartProps> {
if (equal(nextProps, props)) {
return;
}
this.props = nextProps;

this.props = deepMix({}, props, nextProps);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不用 mix, 直接 this.props = nextProps 就好了,这是全量更新

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@tangying1027 tangying1027 changed the title 修复宽高改变的情况 fix:修复宽高改变的情况 Jun 7, 2022
@lgtm-com
Copy link

lgtm-com bot commented Jun 7, 2022

This pull request introduces 1 alert when merging f381e34 into bf4e870 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented Jun 7, 2022

This pull request introduces 1 alert when merging a9e1f75 into bf4e870 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@tangying1027 tangying1027 force-pushed the fix_bug branch 2 times, most recently from c652e52 to b6b875c Compare June 8, 2022 08:52
@lgtm-com
Copy link

lgtm-com bot commented Jun 8, 2022

This pull request introduces 1 alert when merging b6b875c into bf4e870 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented Jun 8, 2022

This pull request introduces 1 alert when merging 447e3ab into bf4e870 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@zengyue zengyue merged commit 51f312e into master Jun 9, 2022
@zengyue zengyue deleted the fix_bug branch June 9, 2022 06:18
@hy-pillow
Copy link

f2-react 可以同步支持吗,props 变化时,内部调用 canvas.resize()

@tangying1027
Copy link
Contributor Author

可以在f2-react那边获取canvas实例,然后调用

@hy-pillow
Copy link

是的,不过如果可以内部封装掉,API 上对 react 更加友好一些

@js0205
Copy link

js0205 commented Jul 8, 2022

请问有ref.current.resize()的用法吗?

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.

None yet

4 participants