Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

178
Visualizações
Error in mounted hook: "ReferenceError: _that is not defined"

i use the ganja.js in my project i pasted the code into the <script> tag of the html file, it works. but when i paste the same code in the mounted() of vue, it gaves a error as the title

  mounted() {
    Algebra(2,0,1,()=>{
      var line = (a,b,c)=>a*1e1 + b*1e2 + c*1e0;
      var point = (x,y)=>!(1e0 + x*1e1 + y*1e2);
      var A = point(-1, -1), B = point(-1, 1), C = point(1, 1);
      var L = line(1, 1, -0.5)
      var M = ()=>C & A;
      var D = ()=>L ^ M;
      let container = document.getElementById('container');
      console.log(this);
      container.appendChild(this.graph([
        "Drag A,B,C",   // First label is used as title.
        0xD0FFE1,       // Numbers are colors - use hex!
        [A,B,C],        // render polygon ABC.
        0x882288,       // Set the color to purple.
        [B,C],          // Render line segment from B to C.
        0x00AA88,       // Medium green.
        L, "L", M, "M", // Render and label lines.
        0x224488,       // Set color blue.
        D, "D",         // Intersection point of L and M
        0x008844,       // Set darker green
        A, "A",         // Render point A and label it.
        B, "B",         // Render point B and label it.
        C, "C",         // Render point C and label it.
      ],{
        grid        : true, // Display a grid
        labels      : true, // Label the grid
        lineWidth   : 3,    // Custom lineWidth (default=1)
        pointRadius : 1,    // Custon point radius (default=1)
        fontSize    : 1,    // Custom font size (default=1)
        scale       : 1,    // Custom scale (default=1), mousewheel.
      }));
    });
  }

The reason for the error is the use of "this.grpah", when i print "this" in console, the error is also raised. And i print "this" in html file, it works. The output result is as follows:

class Element extends generator{
// constructor - create a floating point array with the correct number of coefficients.
  constructor(a) { super(a); if (this.upgrade) this.upgrade(); return this…

How can I use "this" in the arrow function as a parameter of Algebra() in the Vue? Any advise on this would be much appreciated. Thank you.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda