[Q] How do we add conditional HTML or domc components?
trsh opened this issue · comments
Janis commented
Could not find any examples.
update: scope => {
return {
someCond: scope.localVar === 'me' ? 'yes' : 'no'
}
},
This is just variable change.
Janis commented
Something like this?
domc.component("input-title", {
create: scope => {
return {};
},
update: scope => {
return {
html: scope.showControl() ? `<div class="input-title">{{ input.name }}</div>` : ``
};
},
template: `{{ html }}`
});
Pavel Martynov commented
Not like that.
The library missing v-if directive for now and doesn't support node replacing, allowing only insert it at first render.
kokujin commented
Any news on this?
Pavel Martynov commented
Not so. I'll update ticket once implemented.
Andreas Rozek commented
I've just proposed a sketch of a possible implementation of a v-if
directive as a separate issue which might be of help...