Hola, aquí mi solución al reto …
const vueMain = Vue.createApp({
data() {
return {
counter: 0
};
},
methods: {
increment() {
this.counter++;
},
decrement() {
this.counter--;
}
},
template:` <h1>{{ counter }}</h1>
<button v-on:click="increment">+1</button>
<button v-on:click="decrement">-1</button>`,
}).mount("#app");
¿Quieres ver más aportes, preguntas y respuestas de la comunidad?
o inicia sesión.