How to hide a b-tab with VueJS if it has no text

0

The point is that I have a tab panel made with Bootstrap of Vue . Each of these tabs has a textarea which shows a text. Basically I do not know how to make that tab whose textarea is empty, not shown in the tab panel.

So far it had only occurred to me to put a v-if that compared the length of string containing the textarea and if it is less than 1, it would not show, but I do not know the syntax to do that. If someone comes up with another way to make it welcome, be it.

    
asked by Adrián 06.09.2018 в 10:20
source

1 answer

0

In a very crude way but I think it may be worth it for you to have an idea:

<div id="tabs">
  <div id="tab0" v-if="text0.length != 0">
    <textarea v-model="text0" />
  </div>
  <div id="tab1" v-if="text1.length != 0">
    <textarea v-model="text1" />
  </div>
  <div id="tab2" v-if="text2.length != 0">
    <textarea v-model="text2" />
  </div>
</div>
    
answered by 06.09.2018 в 10:34