event buejs code example
Example: event in buejs
<template>
<div>
<button v-on:click="increment">Increment</button>
<button @click="decrement">Decrement</button>
<h4>Counter Count: {{ counter }}</h4>
</div>
</template>
<script>
export default {
name: 'DataEvent',
data: () => ({
counter: 0
}),
methods: {
increment() {
this.counter++
},
decrement() {
this.counter--
}
}
}
</script>
<style scoped>
button {
padding: 5px;
font-size: 20px;
margin: 10px;
}
h4 {
font-size: 18px;
}
</style>