Using chart.js, in vue, there is a tab bar that dynamically switches between different line charts. When the mouse rolls over the chart, it will switch to the previous chart. What's going on?

drawLine () {
  let wrapper = null
  if (this.tabindex == 1) {
    wrapper = document.querySelector("-sharpsignChart1").getContext("2d");
  } else if (this.tabindex == 2) {
    wrapper = document.querySelector("-sharpsignChart2").getContext("2d");
  } else if (this.tabindex == 3) {
    wrapper = document.querySelector("-sharpsignChart3").getContext("2d");
  } else {
    wrapper = document.querySelector("-sharpsignChart4").getContext("2d");
  }
  console.log(wrapper)
  let options = {
    type: "line",
    data: {
      labels: this.chart.labels,
      datasets: this.chart.data
    },
    options: {
      scales: {
        yAxes: [
          {
            ticks: this.chart.ticks
          }
        ]
      }
    }
  };
  this.chartLine = new Chart(wrapper, options);
  this.chartLine.update();
},
Jan.14,2022
Menu