當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。