【问题标题】:Dexie: How do I add a tab to the beginning?Dexie:如何在开头添加标签?
【发布时间】:2018-02-05 18:41:52
【问题描述】:

我们制作了一个开源浏览器。

请更正选项卡的插件。有必要将选项卡添加到开头。现在标签被添加到末尾:

var newTab = tabs.add({}, tabs.getIndex(tabs.getSelected()) + 1)

link to the GitHub repository

尝试了这些选项:

tabs.add({}, 0)
tabs.add({})
tabs.put({})

如何在开头添加标签?

【问题讨论】:

    标签: javascript web browser electron dexie


    【解决方案1】:

    尝试以下方法:

    tabs.add({}, tabs[0]);
    

    它的作用是告诉 js 在列表(数组)的开头添加元素。你可以阅读更多Here

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-12
      相关资源
      最近更新 更多