Override default template only if a condition is true
Lloople opened this issue · comments
David Llop commented
I need to override the default template of this component only if the type of the column is boolean, but this code is currently not working. I don't know how to do it.
David Llop commented
It was needed to loop over another top element instead the component tag. Created a tag <template>
, looped over that element and use v-if
for the component tag to override template or not
<template v-for="column in columns">
<table-column v-if="column.dataType === 'boolean'">
<template>...</template
</table-column>
<table-column v-else></table-column>
</template>