@@ -42,7 +42,8 @@ import configStore from '../configuration/ConfigStore';
42
42
import PlotConfigurationModel from '../configuration/PlotConfigurationModel';
43
43
import LimitLine from './LimitLine.vue';
44
44
import LimitLabel from './LimitLabel.vue';
45
- import Vue from 'vue';
45
+ import mount from 'utils/mount';
46
+ import { toRaw } from 'vue';
46
47
47
48
const MARKER_SIZE = 6.0;
48
49
const HIGHLIGHT_SIZE = MARKER_SIZE * 2.0;
@@ -315,7 +316,7 @@ export default {
315
316
return;
316
317
}
317
318
318
- const elements = this.seriesElements.get(series);
319
+ const elements = this.seriesElements.get(toRaw( series) );
319
320
elements.lines.forEach(function (line) {
320
321
this.lines.splice(this.lines.indexOf(line), 1);
321
322
line.destroy();
@@ -333,7 +334,7 @@ export default {
333
334
return;
334
335
}
335
336
336
- const elements = this.seriesElements.get(series);
337
+ const elements = this.seriesElements.get(toRaw( series) );
337
338
if (elements.alarmSet) {
338
339
elements.alarmSet.destroy();
339
340
this.alarmSets.splice(this.alarmSets.indexOf(elements.alarmSet), 1);
@@ -349,7 +350,7 @@ export default {
349
350
return;
350
351
}
351
352
352
- const elements = this.seriesElements.get(series);
353
+ const elements = this.seriesElements.get(toRaw( series) );
353
354
elements.pointSets.forEach(function (pointSet) {
354
355
this.pointSets.splice(this.pointSets.indexOf(pointSet), 1);
355
356
pointSet.destroy();
@@ -473,7 +474,7 @@ export default {
473
474
this.$emit('plotReinitializeCanvas');
474
475
},
475
476
removeChartElement(series) {
476
- const elements = this.seriesElements.get(series);
477
+ const elements = this.seriesElements.get(toRaw( series) );
477
478
478
479
elements.lines.forEach(function (line) {
479
480
this.lines.splice(this.lines.indexOf(line), 1);
@@ -576,7 +577,7 @@ export default {
576
577
this.seriesLimits.set(series, limitElements);
577
578
},
578
579
clearLimitLines(series) {
579
- const seriesLimits = this.seriesLimits.get(series);
580
+ const seriesLimits = this.seriesLimits.get(toRaw( series) );
580
581
581
582
if (seriesLimits) {
582
583
seriesLimits.limitLines.forEach(function (line) {
@@ -747,16 +748,14 @@ export default {
747
748
left: 0,
748
749
top: this.drawAPI.y(limit.point.y)
749
750
};
750
- let LimitLineClass = Vue.extend(LimitLine);
751
- const component = new LimitLineClass({
752
- propsData: {
751
+ const { vNode } = mount(LimitLine, {
752
+ props: {
753
753
point,
754
754
limit
755
755
}
756
756
});
757
- component.$mount();
758
757
759
- return component.$ el;
758
+ return vNode. el;
760
759
},
761
760
getLimitOverlap(limit, overlapMap) {
762
761
//calculate if limit lines are too close to each other
@@ -792,16 +791,14 @@ export default {
792
791
left: 0,
793
792
top: this.drawAPI.y(limit.point.y)
794
793
};
795
- let LimitLabelClass = Vue.extend(LimitLabel);
796
- const component = new LimitLabelClass({
797
- propsData: {
794
+ const { vNode } = mount(LimitLabel, {
795
+ props: {
798
796
limit: Object.assign({}, overlap, limit),
799
797
point
800
798
}
801
799
});
802
- component.$mount();
803
800
804
- return component.$ el;
801
+ return vNode. el;
805
802
},
806
803
drawAlarmPoints(alarmSet) {
807
804
this.drawAPI.drawLimitPoints(
0 commit comments