-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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
when init echarts on __DEV__ env, warn can't get dom width or height #6528
Comments
This usually happens when code can't get |
thanks, I found the problem is using elementUI tab component, if I put the echartDiv out of tab component, there will be render expectation. I will track this problem. <div id="myChart2" :style="{width: '500px', height: '300px'}"></div>
<el-tabs type="card">
<el-tab-pane label="图表" class="tab-item">
<div id="myChart" :style="{width: '500px', height: '300px'}"></div>
</el-tab-pane>
</el-tabs> |
The key of the problem is let the init dom have <el-tabs type="card" v-model="firstTabValue">
<el-tab-pane label="图表" class="tab-item" name="0">
<el-card class="box-card">
<div id="myChart" :style="{width: '500px', height: '300px'}" ></div>
</el-card>
</el-tab-pane>
<el-tab-pane label="表格" name="1"></el-tab-pane>
</el-tabs> export default {
name: 'Layout',
data () {
return {
firstTabValue: '1'
}
}
} If the echart tab-pane don't first display, you could trigger setOption in the @tab-click event If someone find the better solution, please tell me, thanks. |
One-line summary [问题简述]
When i init the echarts dom in the webpack env, always get the warnning "Can't get dom width or height."
Version & Environment
I used vue + webpack + echarts3
ECharts option
Other comments
I see the warn stack, and found the reason maybe can't get the canvas dom.
In the pic, my dom is a div, but the code is detection the dom whether a canvas, i don't see any code to add canvas tag before the dom judge.
thanks.
The text was updated successfully, but these errors were encountered: