\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.

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: W3D TeamStatus: Published(Update)Question passed 5 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!