You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It even seems like the options is also using default() and not calling it, but just reading?
Workaround I found:
import{h}from"vue";exportdefault{inject: {something: {from: "$_provided",default(){return()=>"default data";}}},render(localH){letdata=this.something();// in v3 `default` seems to not be a function?if(typeofdata==="function"){data=data();}return(h||localH)("div",{},data);}};
The text was updated successfully, but these errors were encountered:
Version
3.0.0-rc.10
Reproduction link
workaround in v2: https://codesandbox.io/s/focused-villani-tpb93?file=/src/components/Consumer.js
workaround in v3: https://codesandbox.io/s/modest-wozniak-bf9gb?file=/src/Consumer.js (sorry, I couldn't make an RC config on code sandbox)
Steps to reproduce
Run this:
render it like this:
What is expected?
output would be:
What is actually happening?
output is:
(since the default is a function)
I'm trying to make a library compatible with v2 & v3 at the same time, but did not see in the options (here: https://v3.vuejs.org/api/options-composition.html#provide-inject) or in the docs (here: https://v3.vuejs.org/guide/component-provide-inject.html#working-with-reactivity).
It even seems like the options is also using
default()
and not calling it, but just reading?Workaround I found:
The text was updated successfully, but these errors were encountered: