गणना केलेला गुणधर्म हा इतर प्रतिक्रियाशील अवस्थेतून व्युत्पन्न केलेला प्रतिक्रियाशील मूल्य आहे. जेव्हा त्याचे अवलंबित्व बदलते तेव्हा ते आपोआप पुनर्गणना करते, आणि — महत्वाचे म्हणून — त्याचा परिणाम कॅश करते जेणेकरून ते केवळ तेव्हाच पुन्हा चालू होते जेव्हा काहीतरी त्यावर अवलंबून असते तर खरोखर बदलते.
<script setup>
import { ref, computed } from "vue";
const firstName = ref("Ann");
const lastName = ref("Lee");
const fullName = computed(() => `${firstName.value} ${lastName.value}`);
// fullName updates automatically whenever firstName OR lastName changes
</script>
<template>
<p>{{ fullName }}</p> <!-- auto-unwrapped, like a ref -->
</template>
