Answers for "How to create a simple counter component in vue JS"

0

How to create a simple counter component in vue JS

<template>
	<div class="button-area">
		<button @click="counter--" class="dec-button">-</button>
		{{ counter }}
		<button @click="counter++" class="inc-button">+</button>
	</div>
</template>

<script>
export default {
	name: "Counter",
	data() {
		return {
			counter: 0,
		};
	},
};
</script>
Posted by: Guest on July-19-2021

Code answers related to "How to create a simple counter component in vue JS"

Code answers related to "Javascript"

Browse Popular Code Answers by Language