Created
February 3, 2018 15:41
-
-
Save honzabilek4/9498a71e6e3770b7d1142ffed3974fbe to your computer and use it in GitHub Desktop.
Vue check if component exist
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
checkIfComponentExists() { | |
const keys = Object.keys(this.$options.components); | |
const names = keys.map(key => { | |
const component = this.$options.components[key]; | |
let name = ''; | |
if (component) { | |
name = component.name; | |
} | |
return name; | |
}); | |
return names.includes(this.contentComponent); | |
}, |
mavitm
commented
Jun 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment