title: VueJS 3 - Different behavior between computed/ref from ‘@vue/composition-api’ and ‘vue’
body: <p>I noticed really strange behavior between nested computed/ref from @vue/composition-api and vue.</p>
  <pre class="lang-js prettyprint-override"><code>const options = ref([{
    val: computed(() =&gt; 10)
  }])
  </code></pre>
  <p><strong>Print value with VueJS 2</strong></p>
  <pre class="lang-js prettyprint-override"><code>console.log(options.value[0].val.value) // 10
  </code></pre>
  <p><a href="https://jsfiddle.net/shenron/q7wxon95/13/" rel="nofollow noreferrer">https://jsfiddle.net/shenron/q7wxon95/13/</a></p>
  <p><strong>Print value with VueJS 3</strong></p>
  <pre class="lang-js prettyprint-override"><code>console.log(options.value[0].val) // 10
  </code></pre>
  <p><a href="https://jsfiddle.net/shenron/q7wxon95/10/" rel="nofollow noreferrer">https://jsfiddle.net/shenron/q7wxon95/10/</a></p>
  <p><strong>Use case</strong></p>
  <p>My use case, I have two components. A custom Select and a custom Option. The custom select provide a list of options, and each option register itself.</p>
  <p>Here the type of the list of options:</p>
  <pre class="lang-js prettyprint-override"><code>type Option = { 
    value: string;
    label: string;
    root: Ref&lt;HTMLElement&gt;
  };
  const options: Ref&lt;Array&lt;Option&gt;&gt; = ref([]);
  </code></pre>
  <p>The custom select to access to <code>root</code> has to do:</p>
  <pre class="lang-js prettyprint-override"><code>// VueJS 3
  options.value.forEach((opt) =&gt; console.log(opt.root)) // not opt.root.value
  
  // VueJS 2
  options.value.forEach((opt) =&gt; console.log(opt.root.value))
  </code></pre>
  <p><a href="https://jsfiddle.net/shenron/q7wxon95/" rel="nofollow noreferrer">https://jsfiddle.net/shenron/q7wxon95/</a></p>
  <p>I’m a bit confused, is it normal?</p>
  <p>Thank you very much.</p>
  <p>Original question:
  <a href="https://forum.vuejs.org/t/different-behavior-between-computed-ref-from-vue-composition-api-and-vue/112717" rel="nofollow noreferrer">https://forum.vuejs.org/t/different-behavior-between-computed-ref-from-vue-composition-api-and-vue/112717</a></p>