Note: This is a short warm-up question meant to help you familiarize yourself with the coding workspace. Actual UI coding interview questions will be more complicated.
Make the text within the button display the number of times the button has been clicked.
1<script setup>2import { ref } from 'vue';34const count = ref(0);5</script>67<template>8 <button @click="count++">Clicks: {{ count }}</button>9</template>
This is a short question that only requires one state variable: the number of times the button has been clicked (count).
Declare count as a variable and attach a @click handler to the <button> that increments the count when the event is triggered.
console.log() statements will appear here.