本文整理匯總了TypeScript中@phosphor/widgets.Panel.insertWidget方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Panel.insertWidget方法的具體用法?TypeScript Panel.insertWidget怎麽用?TypeScript Panel.insertWidget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@phosphor/widgets.Panel
的用法示例。
在下文中一共展示了Panel.insertWidget方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should insert a widget at the specified index', () => {
let panel = new Panel();
let widget = new Widget();
panel.addWidget(new Widget());
panel.insertWidget(0, widget);
expect(panel.widgets[0]).to.equal(widget);
});
示例2: addLabel
addLabel() {
this.label = new Panel();
this.labelContent = new Widget();
this.labelContent.node.innerText = `${this.model.get('headerLabel') || DEFAULT_LABEL_TEXT}`;
this.labelContent.node.classList.add('foldout-label-content');
this.label.node.classList.add('foldout-label');
this.label.node.addEventListener('click', this.headerClickCallback.bind(this));
this.label.insertWidget(0, this.labelContent);
this.pWidget.insertWidget(0, this.label);
}
示例3: render
render() {
const manager = this.model.widget_manager
const rendermime = manager.renderMime;
this._outputView = new OutputArea({
rendermime: rendermime,
model: this.model.outputs
})
this.pWidget.insertWidget(0, this._outputView);
this.pWidget.addClass('jupyter-widgets');
this.pWidget.addClass('widget-output');
this.update();
}