\n\n\n\n\n```","suggestedAnswer":[{"@type":"Answer","text":"You should use a `

Question from the Vue.js test

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

Archived

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: Archived(New question!)Question passed 386 times
2
Community EvaluationsNo one has reviewed this question yet, be the first!