|
@@ -26,6 +26,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
chart: null,
|
|
|
+ timestr:'',
|
|
|
option: {
|
|
|
series: [
|
|
|
{
|
|
@@ -233,7 +234,8 @@ export default {
|
|
|
this.chart.setOption(this.option)
|
|
|
// return
|
|
|
var that=this;
|
|
|
- setInterval(function () {
|
|
|
+ clearInterval(this.timestr)
|
|
|
+ that.timestr=setInterval(function () {
|
|
|
var date = new Date();
|
|
|
var y = date.getFullYear();
|
|
|
var m = date.getMonth() + 1;
|
|
@@ -279,12 +281,14 @@ export default {
|
|
|
that.chart.setOption(optione);
|
|
|
}, 1000);
|
|
|
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
if (!this.chart) {
|
|
|
return
|
|
|
}
|
|
|
+ clearInterval(this.timestr)
|
|
|
this.chart.dispose()
|
|
|
this.chart = null
|
|
|
},
|