Skip to content

Usage with computed property and <component> #6

Discussion options

You must be logged in to vote

Thanks for getting back to me. I've been getting my head around defineAsyncComponent which is where my confusion was. My computed method only needs to return a string really. My other issue was getting hold of the main App object so assigned this to window.app and of course, failing to add a reference to Vue. (I've only delved into Vue a few times but planning on really understanding "the innards" this time - seeemed sensible to start with Vue3!). For reference, if anyone comes here for the same thing, my solution was:

<template>
    <div>
        <component v-if="name" :is="currentLayout"></component>
        <p v-else>
            No Layout Selected
        </p>
    </div>
</template>

…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@FranckFreiburger
Comment options

Comment options

You must be logged in to vote
3 replies
@FranckFreiburger
Comment options

@FranckFreiburger
Comment options

@titantwentyone
Comment options

Answer selected by FranckFreiburger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants