当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript dnd-tree-view.append函数代码示例

本文整理汇总了TypeScript中dnd-tree-view.append函数的典型用法代码示例。如果您正苦于以下问题:TypeScript append函数的具体用法?TypeScript append怎么用?TypeScript append使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了append函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: walk

  function walk(entry: SupCore.Data.EntryNode, parentEntry: SupCore.Data.EntryNode, parentElt: HTMLLIElement) {
    const liElt = createEntryElement(entry);
    liElt.classList.add("collapsed");

    const nodeType: "item"|"group" = (entry.children != null) ? "group" : "item";
    widget.append(liElt, nodeType, parentElt);

    if (entry.children != null) for (const child of entry.children) walk(child, entry, liElt);
  }
开发者ID:Pangoraw,项目名称:superpowers-core,代码行数:9,代码来源:index.ts

示例2: onRegistryReceived

function onRegistryReceived(event: any) {
  if (event.type !== "registry") {
    // TODO: Whoops?! Handle error?
    console.log(event);
    return;
  }

  if (event.error == null && event.registry != null) {
    registry = event.registry;
    const systemsById = registry.systems;

    for (const systemId in systemsById) {
      const system = systemsById[systemId];

      const systemElt = html("li", { dataset: { id: systemId } });
      html("div", "label", { parent: systemElt, textContent: systemId });
      html("div", "progress", { parent: systemElt });
      treeView.append(systemElt, "group");

      for (const authorName in system.plugins) {
        const plugins = system.plugins[authorName];

        const authorElt = html("li");
        html("div", "label", { parent: authorElt, textContent: `${authorName} (${Object.keys(plugins).length} plugins)` });
        treeView.append(authorElt, "group", systemElt);

        for (const pluginName in plugins) {
          const pluginElt = html("li", { dataset: { id: `${systemId}:${authorName}/${pluginName}` } });
          html("div", "label", { parent: pluginElt, textContent: pluginName });
          html("div", "progress", { parent: pluginElt });
          treeView.append(pluginElt, "item", authorElt);
        }
      }
    }
  } else {
    registry = null;
  }

  for (const getRegistryCallback of getRegistryCallbacks) getRegistryCallback(registry);
  getRegistryCallbacks.length = 0;
}
开发者ID:nitpum,项目名称:superpowers-app,代码行数:41,代码来源:systems.ts

示例3: onRegistryReceived

function onRegistryReceived(event: any) {
  if (event.type !== "registry") {
    // TODO: Whoops?! Handle error?
    console.log(event);
    return;
  }

  registry = event.registry;
  const systemsById = registry.systems;

  for (const systemId in systemsById) {
    const system = systemsById[systemId];

    const systemElt = html("li", { dataset: { systemId }});
    html("div", "label", { parent: systemElt });
    treeView.append(systemElt, "group");

    updateSystemLabel(systemId);

    for (const authorName in system.plugins) {
      const plugins = system.plugins[authorName];

      const authorElt = html("li");
      html("div", "label", { parent: authorElt, textContent: `${authorName} (${Object.keys(plugins).length} plugins)` });
      treeView.append(authorElt, "group", systemElt);

      for (const pluginName in plugins) {
        // const plugin = plugins[pluginName];

        const pluginElt = html("li");
        html("div", "label", { parent: pluginElt, textContent: `${pluginName}` });
        treeView.append(pluginElt, "item", authorElt);
      }
    }
  }
}
开发者ID:saucyfai,项目名称:superpowers-app,代码行数:36,代码来源:systems.ts

示例4: addServer

function addServer(serverEntry: ServerEntry) {
  const serverElt = document.createElement("li");
  serverElt.dataset["serverId"] = serverEntry.id;
  serversTreeView.append(serverElt, "item");

  const labelElt = document.createElement("div");
  labelElt.classList.add("label");
  labelElt.textContent = serverEntry.label;
  serverElt.appendChild(labelElt);

  const hostElt = document.createElement("div");
  hostElt.classList.add("host");

  const host = serverEntry.hostname + (serverEntry.port != null ? `:${serverEntry.port}` : "");
  hostElt.textContent = host;
  serverElt.appendChild(hostElt);
}
开发者ID:mk-pmb,项目名称:superpowers-app,代码行数:17,代码来源:sidebar.ts


注:本文中的dnd-tree-view.append函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。