<script>
var app = new Vue ({
el: '#app',
data : {
sentence: ''
},
methods: {
Q: function () {
this.sentence = "Q"
},
W: function () {
this.sentence = "W"
},
E: function () {
this.sentence = "E"
},
R: function () {
this.sentence = "R"
},
T: function () {
this.sentence = "T"
},
Y: function () {
this.sentence = "Y"
}
}
})
</script>
<div id="app">
<p>Sentence : {{ sentence }}</p>
<button @click="Q">Q</button>
<button @click="W">W</button>
<button @click="E">E</button>
<button @click="R">R</button>
<button @click="T">T</button>
<button @click="Y">Y</button>
</div>
The program is working. But first of all the user click 'Q' and after that click 'W', the input seems 'W' , i want this input: "QW" , it should be combine.
For example the user click Q, W and E, the input should be "QWE". How can i combine all of them? Maybe its easy but i couldnt find anywhere. I am beginner on VueJS
Can you help me?