Skip to content

Instantly share code, notes, and snippets.

@afontcu
Created July 28, 2018 16:10
Show Gist options
  • Save afontcu/7f44d389bbb7f38bb158ec944ee9e258 to your computer and use it in GitHub Desktop.
Save afontcu/7f44d389bbb7f38bb158ec944ee9e258 to your computer and use it in GitHub Desktop.
<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