Closed
Description
Version
3.2.0-beta.5
Reproduction link
Steps to reproduce
Create a parent component like this one:
<template>...</template>
<script>
import { computed } from 'vue';
export default {
provide: {
user: computed(() => 'jim'),
},
};
</script>
And then create a child component like this one:
<template>
<div>{{ user.value }}</div>
</template>
<script>
export default {
inject: ['user'],
}
</script>
What is expected?
I should not need to use .value
in the template in order to be consistent with reactivity in the composition API.
What is actually happening?
I am required to use .value
when using using computed() to make items reactive with provide/inject, but I don't have to use .value when using computed() with the composition API.
This behavior seems inconsistent. At a minimum, it seems like this inconsistency should receive better treatment in the docs to explain why there's a difference.