Can someone help me figure out why all my buttons are getting disabled when I only want one to be disabled? Here is the code where I created a counter with vue.js:
<body>
<div id="app">
<button @click="count++" v-bind:disabled="blockCount">increment</button>
<button @click="count--">decrement</button>
<p>The count is {{ count }}</p>
<p>{{ message }}</p>
<button v-on:click="reverseMessage">Reverse Message</button>
<p v-if="count >= 7" blockCountChange()> </p>
</div>
<script>
const example1 = new Vue({
el: '#app',
data: {
message: 'Hello Vue ! Just a test',
count:'',
blockCount: false
},
methods: {
reverseMessage: function () {
this.message = this.message.split(' ').reverse().join(' ')
},
blockCountChange: {
function() {
if (this.count>5) {
return this.blockCount = true;
}
}
}
}
});
</script>
</body>