-
Notifications
You must be signed in to change notification settings - Fork 649
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
fix:修复宽高改变的情况 #1507
Conversation
packages/f2/src/canvas/index.ts
Outdated
@@ -147,10 +147,39 @@ class Canvas extends Component<ChartProps> { | |||
if (equal(nextProps, props)) { | |||
return; | |||
} | |||
this.props = nextProps; | |||
|
|||
this.props = deepMix({}, props, nextProps); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不用 mix, 直接 this.props = nextProps
就好了,这是全量更新
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
This pull request introduces 1 alert when merging f381e34 into bf4e870 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging a9e1f75 into bf4e870 - view on LGTM.com new alerts:
|
c652e52
to
b6b875c
Compare
This pull request introduces 1 alert when merging b6b875c into bf4e870 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 447e3ab into bf4e870 - view on LGTM.com new alerts:
|
f2-react 可以同步支持吗,props 变化时,内部调用 canvas.resize() |
可以在f2-react那边获取canvas实例,然后调用 |
是的,不过如果可以内部封装掉,API 上对 react 更加友好一些 |
请问有ref.current.resize()的用法吗? |
Checklist
npm test
passesDescription of change