I am using Nuxt.js and I have this problem, with reading the running property of my client object.(我正在使用Nuxt.js,但在读取客户端对象的running属性时遇到了这个问题。)
HTML:(HTML:)
<b-button
v-show="!(projectSelecter(project.ID)).isStarted" //this work just fine
variant="success"
class="control_buttons"
@click="start(project.ID)"
>Start</b-button>
JS:(JS:)
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();
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;
},
This is the reset function, which is called in the start function above.(这是复位功能,在上面的启动功能中调用。)
reset: function(id) {
var client=this.projectSelecter(id);
client.running = false;
clearInterval(client.started);
client.stoppedDuration = 0;
client.timeBegan = null;
client.timeStopped = null;
client.time = "00:00";
client.isStarted=false;
}
Console logs:(控制台日志:)
Error message:(错误信息:)
Full:(充分:)
ask by Alex Denor translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…