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


TypeScript string.uniqueId函数代码示例

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


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

示例1: render

  render(): void {
    super.render()
    empty(this.el)

    const name = uniqueId()

    const active = this.model.active
    const labels = this.model.labels

    for (let i = 0; i < labels.length; i++) {
      const text = labels[i]

      const inputEl = input({type: `radio`, name: name, value: `${i}`})
      inputEl.addEventListener("change", () => this.change_input())

      if (this.model.disabled)
        inputEl.disabled = true
      if (i == active)
        inputEl.checked = true

      const labelEl = label({}, inputEl, text)
      if (this.model.inline) {
        labelEl.classList.add("bk-bs-radio-inline")
        this.el.appendChild(labelEl)
      } else {
        const divEl = div({class: "bk-bs-radio"}, labelEl)
        this.el.appendChild(divEl)
      }
    }
  }
开发者ID:Zyell,项目名称:bokeh,代码行数:30,代码来源:radio_group.ts

示例2: toColumn

 toColumn(): Column {
   return {
     id: uniqueId(),
     field: this.field,
     name: this.title,
     width: this.width,
     formatter: this.formatter != null ? this.formatter.doFormat.bind(this.formatter) : undefined,
     model: this.editor,
     editor: this.editor.default_view,
     sortable: this.sortable,
     defaultSortAsc: this.default_sort == "ascending",
   }
 }
开发者ID:Zyell,项目名称:bokeh,代码行数:13,代码来源:table_column.ts

示例3: newIndexColumn

 newIndexColumn() {
   return {
     id: uniqueId(),
     name: "#",
     field: DTINDEX_NAME,
     width: 40,
     behavior: "select",
     cannotTriggerInsert: true,
     resizable: false,
     selectable: false,
     sortable: true,
     cssClass: "bk-cell-index",
   };
 }
开发者ID:FourtekIT-incubator,项目名称:bokeh,代码行数:14,代码来源:data_table.ts

示例4: toColumn

 toColumn(): {
   id: string,
   field: string,
   name: string,
   width: number,
   formatter: (...args: any[]) => HTMLElement,
   editor: Class<View>,
   sortable: boolean,
   defaultSortAsc: boolean,
 } {
   return {
     id: uniqueId(),
     field: this.field,
     name: this.title,
     width: this.width,
     formatter: (this.formatter != null ? this.formatter.doFormat.bind(this.formatter) : undefined),
     editor: this.editor.default_view,
     sortable: this.sortable,
     defaultSortAsc: this.default_sort === "ascending",
   };
 }
开发者ID:FourtekIT-incubator,项目名称:bokeh,代码行数:21,代码来源:table_column.ts

示例5: render

  render(): void {
    super.render()

    const group = div({class: ["bk-input-group", this.model.inline ? "bk-inline" : null]})
    this.el.appendChild(group)

    const name = uniqueId()
    const {active, labels} = this.model

    for (let i = 0; i < labels.length; i++) {
      const radio = input({type: `radio`, name, value: `${i}`})
      radio.addEventListener("change", () => this.change_active(i))

      if (this.model.disabled)
        radio.disabled = true
      if (i == active)
        radio.checked = true

      const label_el = label({}, radio, span({}, labels[i]))
      group.appendChild(label_el)
    }
  }
开发者ID:digitalsatori,项目名称:Bokeh,代码行数:22,代码来源:radio_group.ts

示例6: render

  render(): void {
    super.render()

    empty(this.el)
    const divEl = div({class: "bk-bs-btn-group"})
    this.el.appendChild(divEl)

    const name = uniqueId()

    const active = this.model.active
    const labels = this.model.labels

    for (let i = 0; i < labels.length; i++) {
      const text = labels[i]
      const inputEl = input({type: `radio`, name: name, value: `${i}`, checked: i == active})
      inputEl.addEventListener("change", () => this.change_input())
      const labelEl = label({class: [`bk-bs-btn`, `bk-bs-btn-${this.model.button_type}`]}, inputEl, text)
      if (i == active)
        labelEl.classList.add("bk-bs-active")
      divEl.appendChild(labelEl)
    }
  }
开发者ID:Zyell,项目名称:bokeh,代码行数:22,代码来源:radio_button_group.ts


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