Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!