简体   繁体   English

语义UI选项卡历史记录可激活选项卡

[英]Semantic-UI tab history activates tabs

I'm using a menu object in Semantic and if I set the tab history state to true, it will always load the page content with a tab activated, despite none of the tabs being active to begin with. 我在语义中使用菜单对象,并且如果将选项卡历史记录状态设置为true,则尽管选项卡中的任何一个都不处于活动状态,它始终会在激活选项卡的情况下加载页面内容。 The full context source is a big cumbersome but is found here . 完整的上下文资源非常繁琐,但可以在此处找到。 As you can see, it loads with the first "About" tab open, despite not containing the active class in the tab content's code: 如您所见,尽管在选项卡内容的代码中未包含active类,但它会在第一个“关于”选项卡打开的情况下加载:
<div class="ui tab segment" data-tab="about">

Some relevant bits: 一些相关的位:

readyState function: readyState函数:

$(document).ready(function(){
$('.links.menu .item').tab({
        history : true,
        historyType : 'hash',
    });
    $('.links.menu').transition({
        animation : 'fade down',
        duration : '1s'
    });
});

In the documenation it is said that "Tabs use Asual's Address library to provide cross-browser push state support. This is a required dependency for tabs with history to work correctly." 文档中 ,据说“选项卡使用Asual的地址库来提供跨浏览器的推送状态支持。这是具有历史记录的选项卡正常工作所必需的依赖项。” Have you included the library in the dependencies ? 您是否已将包含在依赖项中?

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

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