本文整理汇总了TypeScript中core/dom.select函数的典型用法代码示例。如果您正苦于以下问题:TypeScript select函数的具体用法?TypeScript select怎么用?TypeScript select使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了select函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: render
render(): void {
super.render()
empty(this.el)
const labelEl = label({for: this.model.id}, this.model.title)
this.el.appendChild(labelEl)
const options = this.model.options.map((opt) => {
let value, _label
if (isString(opt))
value = _label = opt
else
[value, _label] = opt
return option({value}, _label)
})
this.selectEl = select({
multiple: true,
class: "bk-widget-form-input",
id: this.model.id,
name: this.model.name,
disabled: this.model.disabled,
}, options)
this.selectEl.addEventListener("change", () => this.change_input())
this.el.appendChild(this.selectEl)
this.render_selection()
}
示例2: render
render(): void {
super.render()
const options = this.model.options.map((opt) => {
let value, _label
if (isString(opt))
value = _label = opt
else
[value, _label] = opt
return option({value}, _label)
})
this.select_el = select({
multiple: true,
class: "bk-input",
name: this.model.name,
disabled: this.model.disabled,
}, options)
this.select_el.addEventListener("change", () => this.change_input())
this.group_el.appendChild(this.select_el)
this.render_selection()
}
示例3: render
render(): void {
super.render()
empty(this.el)
const labelEl = label({for: this.model.id}, this.model.title)
this.el.appendChild(labelEl)
let contents: HTMLElement[]
if (isArray(this.model.options))
contents = this.build_options(this.model.options)
else {
contents = []
const options = this.model.options
for (const key in options) {
const value = options[key]
contents.push(optgroup({label: key}, this.build_options(value)))
}
}
this.selectEl = select({
class: "bk-widget-form-input",
id: this.model.id,
name: this.model.name,
disabled: this.model.disabled}, contents)
this.selectEl.addEventListener("change", () => this.change_input())
this.el.appendChild(this.selectEl)
}
示例4: _createInput
protected _createInput(): HTMLSelectElement {
return select()
}
示例5: _createInput
protected _createInput() {
return select()
}