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: 修复调用图表的dispose时报异常 #942

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ec-canvas/wx-canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export default class WxCanvas {
// noop
}

removeEventListener() {
// noop
}

attachEvent() {
// noop
}
Expand Down
4 changes: 2 additions & 2 deletions pages/lazyLoad/index.wxml
Copy link
Author

Choose a reason for hiding this comment

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

延迟加载示例稍作调整,使其可以反复操作”加载-释放-加载-释放“

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--index.wxml-->
<view class="container">
<button bindtap="init" wx:if="{{!isLoaded}}">加载图表</button>
<button bindtap="init" wx:if="{{!isLoaded || isDisposed}}">加载图表</button>
<button bindtap="dispose" wx:if="{{isLoaded && !isDisposed}}">释放图表</button>
<ec-canvas wx:if="{{!isDisposed}}" id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>
<ec-canvas id="mychart-dom-bar" canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>
</view>