We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In vue2 with composition-api: I have the following (simplified) code:
export default defineComponent({ name: "c-item-description", props: { item: { type: Object, default: () => ({}) }, presentationComponent: String, }, setup(props, context) { const { dynamicComponentRef} = useItemDescriptionConfiguration(props); return () => { const DynamicComponent: any = dynamicComponentRef.value || "t-item-description"; return ( <keep-alive> <DynamicComponent item={props.item} /> </keep-alive> ); }; } });
I found a workaround. Is it supposed to be so?
import { defineComponent, computed, ref,getCurrentInstance } from 'vue'; export default defineComponent({ name: "tsx-world", props: { msg: String }, setup(props, context) { const dynamicComponent = ref("local-title"); // read from configuration const myTitleRef = computed(()=>getCurrentInstance()?.appContext?.components[dynamicComponent.value]); return () => { const myTitle = myTitleRef.value; return ( <myTitle msg="dynamic component" /> );} } });
The text was updated successfully, but these errors were encountered:
try
- const DynamicComponent: any = dynamicComponentRef.value || "t-item-description"; + const DynamicComponent: any = dynamicComponentRef.value || resolveComponent("t-item-description");
https://v3.vuejs.org/api/global-api.html#resolvecomponent
Sorry, something went wrong.
Issue is resolved. Thank you.
No branches or pull requests
In vue2 with composition-api: I have the following (simplified) code:
I found a workaround. Is it supposed to be so?
The text was updated successfully, but these errors were encountered: