Being a novice in the realm of Vue, I am eager to gain knowledge on how to effectively create and reuse Vue components. However, I am encountering an issue where the initial data passed to a component does not update upon a click event. Shown below is a snippet of my code (full version available at https://jsfiddle.net/gpawel/486ysvxj/33/). Could you please point out what might be causing this problem? Thank you.
<div id="components-demo">
<button-counter count='3'></button-counter>
<br><br>
<button-counter count='4'></button-counter>
</div>
Vue.component('button-counter', {
props: ['count'],
methods: {
add: function() {
return {count: count++}
}
},
template: '<button v-on:click="add()">You clicked me {{count}} times.</button>'
})
new Vue({
el: '#components-demo'
})