2👍
The error is in skor, you forgot to add these parenthesis after it (), that’s how you call a javascript function
<h1>Skor : {{skor()}}</h1>
- [Vuejs]-BeforeMount not working on a computed method
- [Vuejs]-VueJS How to show/hide closest hidden element in list of items
1👍
You’re using the function skor
to determine when to add +1, but your variable you’re assigning to is wrong. It should be this.crameworks[0].skor + 1
. Also, that should be the number 0
and not the string '0'
in your data initialization.
You have also declared data
twice in your Vue initializer. Combine those into a single data: {}
object.
- [Vuejs]-How to use Math.round to round values returned from JSON object in Vue.js
- [Vuejs]-KeyError at / 'assets' and ModuleNotFoundError: No module named 'webpack_loader'
0👍
this.skor
refers to the method, so the following is referencing the method:
<h1>Skor : {{skor}}</h1>
In order to access the data you need to reference it in the right spot, crameworks[0].skor
:
<h1>Skor : {{crameworks[0].skor}}</h1>
Source:stackexchange.com