typescript - How do I hide and/or unhide the TabViewItem component in NativeScript? -


how display , hide component in nativescript using tag tabviewitem? want able have option display and/or hide tab.

<tabview>     <tabview.items>         ...         <tabviewitem title="logoff">             <tabviewitem.view >                 ...             </tabviewitem.view>         </tabviewitem>     </tabview.items> </tabview> 

below examples of have tried:

<tabview>     <tabview.items>         ...         <tabviewitem title="logoff" [visibility]="settings.showlogin ? 'collapsed' : 'visible'">             <tabviewitem.view >                 ...             </tabviewitem.view>         </tabviewitem>     </tabview.items> </tabview> 

with css:

<tabviewitem title="logoff" class="hidetab">  .hidetab{     display: none; } 

and

<tabviewitem title="logoff" [class.hidetab]="true"> 

thanks!

your code looks little bit strange. trying achieve [visibility] , [class.hidetab]?

anyways, visibility property want use control visibility.

e.g. hide component:

<component visibility="collapse" /> 

as other value, can set variable set on binding context. e.g. if have isshown boolean variable on binding context, it'll control visibility:

<component visibility="{{ isshown ? 'visible' : 'collapse' }} /> 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -