Here is my code for updating and displaying the number of elapsed seconds:
<template>
<div>
{{timerValue}}
</div>
</template>
<script>
export default {
name: "App",
components: {
},
data() {
return {
timerValue: ""
}
},
created() {
let seconds = 0;
this.timerValue = seconds;
setInterval(function() {
seconds++;
})
}
};
</script>
Despite my efforts, the page always displays
0
I'm not sure what I am doing wrong. Can someone help me figure it out?
https://codesandbox.io/s/still-cache-1mdgr6?file=/src/App.vue