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


TypeScript vdom.h类代码示例

本文整理汇总了TypeScript中phosphor/lib/ui/vdom.h的典型用法代码示例。如果您正苦于以下问题:TypeScript h类的具体用法?TypeScript h怎么用?TypeScript h使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: render

  /**
   * Render the content as virtual DOM nodes.
   */
  protected render(): VNode | VNode[] {
    if (!this.model) {
      return h.table([h.thead(), h.tbody()]);
    }

    let rows = this.model.parse();
    let cols = rows.columns || [];
    return h.table([
      h.thead(cols.map(col => h.th(col))),
      h.tbody(rows.map(row => h.tr(cols.map(col => h.td(row[col])))))
    ]);
  }
开发者ID:danielballan,项目名称:jupyterlab,代码行数:15,代码来源:table.ts

示例2: it

      it('should connect a node to a command', () => {
        let called = false;
        let command = 'commandlinker:connect-node';
        let commands =new CommandRegistry();
        let linker = new CommandLinker({ commands });
        let node: HTMLElement;
        let vnode: VNode;
        let disposable = commands.addCommand(command, {
          execute: () => { called = true; }
        });
        let attrs: IElementAttrs = {};

        vnode = h.div(linker.populateVNodeAttrs(attrs, command, null));
        node = realize(vnode);
        document.body.appendChild(node);

        expect(called).to.be(false);
        simulate(node, 'click');
        expect(called).to.be(true);

        document.body.removeChild(node);
        linker.dispose();
        disposable.dispose();
      });
开发者ID:Carreau,项目名称:jupyterlab,代码行数:24,代码来源:commandlinker.spec.ts

示例3: render

  /**
   * Render the landing plugin to virtual DOM nodes.
   */
  protected render(): VNode {
    let activitiesList: VNode[] = [];
    let activites = this.model.activities;
    for (let activityName of activites) {
      let imgName = activityName[0].replace(' ', '');
      let column =
      h.div({className: LANDING_COLUMN_CLASS},
        h.span({className: LANDING_ICON_CLASS + ` jp-Image${imgName}` ,
                onclick: () => {
                  this._app.commands.execute(activityName[1], void 0);
                }}
        ),
        h.span({className: LANDING_TEXT_CLASS}, activityName[0])
      );
      activitiesList.push(column);
    }

    let logo = h.span({className: JUPYTERLAB_ICON_CLASS + ' ' + LANDING_LOGO_CLASS});
    let subtitle =
    h.span({className: LANDING_SUBTITLE_CLASS},
      this.model.previewMessage
    );
    let tour =
    h.span({className: TOUR_ICON_CLASS,
      onclick: () => {
        this._app.commands.execute('about-jupyterlab:show', void 0);
      }}
    );
    let header = h.span({
      className: LANDING_HEADER_CLASS
    }, this.model.headerText);
    let body = h.div({className: LANDING_BODY_CLASS}, activitiesList);

    let dialog = h.div({className: LANDING_DIALOG_CLASS},
      logo,
      subtitle,
      tour,
      header,
      body,
      h.div({className: LANDING_CWD_CLASS},
        h.span({className: FOLDER_ICON_CLASS + ' ' + FOLDER_CLASS}),
        h.span({className: LANDING_PATH_CLASS}, this.model.path
        )
      )
    );
    return dialog;
  }
开发者ID:danielballan,项目名称:jupyterlab,代码行数:50,代码来源:widget.ts

示例4:

 h.tbody(rows.map(row => h.tr(cols.map(col => h.td(row[col])))))
开发者ID:danielballan,项目名称:jupyterlab,代码行数:1,代码来源:table.ts


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