Home > front end >  Used in the vue echarts can display for the first time, routing can't display after the jump
Used in the vue echarts can display for the first time, routing can't display after the jump

Time:10-06

Use the echarts vue, using histogram on a bullet box, open for the first time, graphics can be displayed, but to jump to other pages, jump back, opened the won't appear, on the code in the browser detection tools not canvas and data, is only an empty div, but the print out the nodes on the document. The getElementById (" histogramChart ") have canvas and data, have a great god can help me solve the

CodePudding user response:

Delay the
Around 100 ms setTimeout

CodePudding user response:

I tried, whether the visualization methods of delay 1 s, or the setOption delay 1 s, are not, as long as open once, and then jump to another page, jump back, can't show the chart,

CodePudding user response:

Excuse me, would you please tell me how to solve this problem, I just met the same situation, lazy loading, nexttick, timers are not solve

CodePudding user response:

Before the routing load, is to get the data, in the routing exclusive guard hook function

 
Const router=new VueRouter ({
Routes: [
{
Path: '/foo,
Component: Foo,
BeforeEnter: (1) the to, from, next)=& gt; {
//get data
}
}
]
})

CodePudding user response:

refer to the second floor hello, little monkey response:
I've tried, neither the visualization methods of delay 1 s, or the setOption delay 1 s, are not, as long as open once, and then jump to another page, jump back, can't out of the chart to display
so how did you solve the building Lord for help
  • Related