İşlevlerin bileşenlere aktarılmasının belgede belirtildiği şekilde çalışmadığı bir sorunum var. Vue.js işlevleri çalışmazken gösteriliyor
Bu
benim app.jsmethods: {
updateAnswer: function(question) {
console.log('question: '+question);
}
}
Bu benim html dosyası içindedir içinde:
props: [
'whenanswered'
],
ready: function() {
this.whenanswered();
},
I:
<multiplechoice class="question counterIncrement counterShow active" id="q2" whenanswered="{{ updateAnswer('1') }}"></multiplechoice>
Bu benim components.js dosyada olduğu
props: [
{ name: 'whenanswered', type: Function}
];
: zaten bu denedi
yine de hayır şans. Ben sayfasını yüklediğinizde
Bu benim konsolda ise:
Uncaught TypeError: this.whenanswered is not a function
Herhangi bir yardım çok mutluluk duyacağız :)