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
The Wormhole docs say hasContentFor will let me check if a portal has content. TypeScript is reporting that this method doesn't exist or isn't exported. It seems like maybe it's not exported for TypeScript? This is really important for my use case, because I need to wrap the portal output in some styles.
Here's a simplified example of what I need. It's critical to our setup, and the reason I'm evaluating portal-vue is because slots and router-view are both failing in our scenario. portal-vue is perfect, except I need to know if content has been defined.
Here's a simplified example:
<!-- this shouldn't appear at all if there's no content because it breaks the page layout --><divv-if="hasSidebarPortalContent"><divclass="something for responsive"><portal-targetname="sidebar" /></div></div>
That's one of the few APIs I dropped for 2.0 since I never came across anyone using them. Which is why you won't find them in the docs for 2.0 on portal-vue.linusb.org. Did you look at old docs perhaps?
I can consider adding it back in, now that I have finally seen a use case for it. 😅
But might take a few days.
As a workaround, you could use this for now:
return!!Wormhole.transports[sidebar].length
Wormhole.transports is not strictly public API but won't change in this major, I can promise that.
LinusBorg
changed the title
Not finding Wormhole.hasContentFor from docs
Add back Wormhole.hasContentFor
Apr 11, 2019
Haha, oh no! I see now that you just removed it a few days ago. I hadn't seen the 2.0 upgrading guide until searching google for the method name. I'm surprised this hasn't come up before! Wrapping things like this in some kind of containers seems like a common use case to me. Thank you for the quick response and the re-add, and the workaround until 2.1 is released. (and all the hard work)
The Wormhole docs say
hasContentFor
will let me check if a portal has content. TypeScript is reporting that this method doesn't exist or isn't exported. It seems like maybe it's not exported for TypeScript? This is really important for my use case, because I need to wrap the portal output in some styles.Here's a simplified example of what I need. It's critical to our setup, and the reason I'm evaluating portal-vue is because slots and
router-view
are both failing in our scenario.portal-vue
is perfect, except I need to know if content has been defined.Here's a simplified example:
Is this just missing from the type export or is there some different way to do this?
The text was updated successfully, but these errors were encountered: