[Vuejs]-Cannot set property 'running' of undefined

1πŸ‘

βœ…

In your reset method,
You need to pass id as parameter in the start method.
So your start method should look like

start: function(id) {
  const client=this.projectSelecter(id);
  console.log("ID: ", id);
  console.log("Client: ", client);
  console.log("Client running property: ", client.running);
  //if (client.running) return;

  if (client.timeBegan === null) {
    this.reset(id); //passing `id` to reset method
    client.timeBegan = new Date();
  }

  if (client.timeStopped !== null) {
    client.stoppedDuration += new Date() - client.timeStopped;
  }

  client.isStarted=!client.isStarted;
  client.started = setInterval(this.clockRunning, 10);
  client.running = true;
},
πŸ‘€Helping hand

Leave a comment