Hello! I am a beginner in Vue.js and I have encountered an issue with my function. Instead of increasing my variable to 1 as expected, it is increasing it to a random number every time. The console is displaying the following error message:
"You may have an infinite update loop in a component render function"
I'm not sure what could be causing this problem. Can you help me diagnose the issue?
<template lang="pug">
#homepage
.workArea
button(
v-on:click='clicker'
)
|click me
p
|{{clicker()}}
</template>
<script>
export default {
name: "test",
data: () => ({
a: 0,
}),
methods: {
clicker() {
return this.a++
},
},
}
</script>