[Vuejs]-(function () { [native code] }) on vue .js

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>
👤addin

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.

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>

Leave a comment