At their basis they allow you to create something that acts as a normal data property but is a function that is chached which does not change until they thing it is derived form changes.
[code]
<script>
export default {
data() { return { a: 4} },
computed: { b() { return this.a + 1 } }
}
</script>
[/code]
So what this does
1. Creates a b
2. Sets its value to a + 1 initially (5)
3. Sets up a watcher so that when a changes, it will re cache its value
It is accessed via this.b
This is done in a few areas in the cost.
Initially it is in state.js in initState where it.
1. creates a listed of _computedWatchers
2. For each computed propert
a. define a getter for the computed property
b. create a lazy Watcher for the property, so that the vm will rerender if it is updated
c. (opt) create a getter for the computed property