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

把initChart放到methods中动态调用报错? #33

Closed
bruce-zhang932 opened this issue Sep 5, 2018 · 4 comments
Closed

把initChart放到methods中动态调用报错? #33

bruce-zhang932 opened this issue Sep 5, 2018 · 4 comments

Comments

@bruce-zhang932
Copy link

看了示例代码不知道为什么要把initChart赋给属性onInit?
因为实际开发中数据都是动态获取赋值的,我就把initChart放到methods中动态调用生成图表。
export default { components: { mpvueEcharts },
data() { return { echarts, dateArr: ["18.08.13", "18.08.13", "18.08.13", "18.08.13"], data: [63, 73, 83, 85], subtext: "单位:cm", title: "身高" // onInit: initChart }; },
methods: { init() { utils.setTitle("结果"); this.onInit(); }, onInit: initChart },
mounted() { this.init(); } };
qq 20180905101203
直接报Cannot read property 'getAttribute' of undefined 的错误,
但是图表还是显示了,不知道是什么原因

@F-loat
Copy link
Owner

F-loat commented Sep 5, 2018

示例主要是根据官方的修改来的,远程数据可以看下懒加载那个示例

@bruce-zhang932
Copy link
Author

@F-loat 您好,可以给下懒加载的示例地址吗?我在官网没有找到

@F-loat
Copy link
Owner

F-loat commented Sep 5, 2018

@bruce-zhang932
Copy link
Author

@F-loat 3Q 完美

@F-loat F-loat closed this as completed Sep 6, 2018
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

No branches or pull requests

2 participants