eco2d/flecs-dash/etc/apps/systems/system_component.js

32 lines
886 B
JavaScript
Raw Normal View History

2021-01-18 16:40:47 +00:00
Vue.component('system-component', {
props: ['component'],
methods: {
css() {
if (this.component.exclude) {
return "system-component-not";
}
return "";
}
},
template: `
<span :class="'system-component ' + css()">
<span class="system-component-annotation" v-if="component.const">
in
</span>
<span class="system-component-annotation" v-if="component.singleton">
$
</span>
<span class="system-component-annotation" v-else-if="component.parent">
parent
</span>
<span class="system-component-annotation" v-else-if="component.ref">
ref
</span>
<span class="system-component-annotation" v-else-if="component.empty">
0
</span>
{{component.name}}
</span>`
});