Lloople / blog

Simple blog with markdown. Development not continued. Project not in use anymore.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Override default template only if a condition is true

Lloople opened this issue · comments

<div v-if="column.type === 'boolean'">

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.

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>