Created
July 28, 2018 16:10
-
-
Save afontcu/7f44d389bbb7f38bb158ec944ee9e258 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<component :is="componentName" /> | |
</div> | |
</template> | |
<script> | |
import UserInfo from './components/UserInfo' | |
import CompanyInfo from './components/CompanyInfo' | |
export default { | |
components: { | |
UserInfo, | |
CompanyInfo, | |
}, | |
props: { | |
isCompany: { type: Boolean, default: false }, | |
}, | |
computed: { | |
componentName () { | |
return this.isCompany ? 'company-info' : 'user-info' | |
}, | |
}, | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment