computed — cached. methods — recalculated.
computed:
methods:
1<script setup>2import { ref, computed } from "vue"34const count = ref(0)56// Computed: cached7const doubled = computed(() => {8 console.log("Computed")9 return count.value * 210})1112// Method: recalculated13const getDoubled = () => {14 console.log("Method")15 return count.value * 216}17</script>
Key: computed for derived state, methods for actions.