简体   繁体   English

v-tab和v-tab-item中的“值”属性如何控制可见性?

[英]How “value” prop in v-tabs and v-tab-item controls visibility?

From Vuetify documentation ( https://vuetifyjs.com/en/components/tabs ) on v-tabs component it says that "value" property "Controls visibility". 在V-tabs组件的Vuetify文档( https://vuetifyjs.com/en/components/tabs )中,它表示“值”属性“控制可见性”。 In which way it controls visibility? 它以哪种方式控制可见性? When I try to set this prop to false I get infinite loop and browser hangs. 当我尝试将此prop设置为false时,出现无限循环,浏览器挂起。 I don't understand how this prop works but I see it used in Vuetify official examples where it's set to string. 我不了解此道具的工作原理,但我看到它在Vuetify官方示例中使用过,该示例将其设置为字符串。

In this case, the value controls which tab is currently selected. 在这种情况下,该值控制当前选择的选项卡。 You bind that value using the v-model property. 您可以使用v-model属性绑定该值。 To show and hide the tabs you can simply use a v-if . 要显示和隐藏选项卡,您只需使用v-if

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM