Skip to content

Commit

Permalink
Merge pull request #6 from mamhoff/add-component-name-helper-to-element
Browse files Browse the repository at this point in the history
Add componentName helper to Element mixin
  • Loading branch information
mamhoff authored Mar 29, 2021
2 parents b067428 + 27a170c commit 90cd735
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mixins/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export default {
getEssence(name) {
return this.element.essences.find((e) => e.role === name) || {}
},
componentName(element) {
const name = element.name
if (this.$options.components[name]) {
return name
}
return "FallbackElement"
},
},
props: {
element: {
Expand Down

0 comments on commit 90cd735

Please sign in to comment.