Question from the Vue.js test

Write a Vue component that displays a button and a counter.

Hard

What is wrong with this code?

<script>
import { defineProps, ref } from 'vue'

const {start} = defineProps({start: Number})
let count = ref(start)

function onClick() {
  count++
}
</script>

<script>
import { onMounted } from 'vue'
onMounted(() => {
  console.log("counter created !")
})
</script>

<template>
  <p>
    you counted {{count}} times!
  </p>
  <button @click="onClick">
    Count
  </button>
</template>
Author: AdrienStatus: PublishedQuestion passed 360 times
Edit
2
Community EvaluationsNo one has reviewed this question yet, be the first!