Start your All-Access Pass to unlock this challenge
Challenge 2 / 2
Say I have this very simple counter component:
<template>
<div v-text="count" />
</template>
<script>
export default {
name: 'CounterComponent',
data() {
return {
count: 0,
};
},
};
</script>
Why is it important that data is a function that returns an object?
Why can't data be set directly to the { count: 0 }
object?
Skip challenges and go to theNext Chapter