Problem Statement
What happens inside setup() and what can you return from it?
Explanation
setup() runs before component creation and has no this. You declare reactive state (ref/reactive), computed values, watchers, and methods. Return an object to expose bindings to the template (or use <script setup> which auto-exposes top-level bindings).
Code Solution
SolutionRead Only
import { ref, computed } from 'vue'
export default {
setup(){
const count = ref(0)
const double = computed(() => count.value * 2)
function inc(){ count.value++ }
return { count, double, inc }
}
}