提交 3b85af8f 编写于 作者: K kener

同一个dom上多次init,自动释放已有实例

上级 16435a9e
......@@ -38,7 +38,11 @@ define(function(require) {
key = new Date() - 0;
dom.setAttribute(DOM_ATTRIBUTE_KEY, key);
}
_instances[key] = _instances[key] || new Echarts(dom);
if (_instances[key]) {
// 同一个dom上多次init,自动释放已有实例
_instances[key].dispose();
}
_instances[key] = new Echarts(dom);
_instances[key].id = key;
_instances[key].setTheme(theme);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册