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

小白提问 #2318

Closed
gjfei opened this issue Jul 3, 2019 · 1 comment
Closed

小白提问 #2318

gjfei opened this issue Jul 3, 2019 · 1 comment

Comments

@gjfei
Copy link

gjfei commented Jul 3, 2019

在src\views\dashboard\admin\components\LineChart.vue下的组件中
在mounted钩子中DOM已经渲染挂载为何还要加上$nexTick?
TIM图片20190703135509

@PanJiaChen
Copy link
Owner

#2060

因为侧边栏其实是会根据屏幕宽度动态调整的,这就会导致,在移动端的情况下,侧边栏会隐藏,这时候如果不加nextTick会导致 图表初始化的宽度是不对的。

简而言之加上nextTick是为了保证初始化图表的时候的宽度

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