本文整理匯總了TypeScript中phosphor-panel.PanelLayout.childAt方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript PanelLayout.childAt方法的具體用法?TypeScript PanelLayout.childAt怎麽用?TypeScript PanelLayout.childAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phosphor-panel.PanelLayout
的用法示例。
在下文中一共展示了PanelLayout.childAt方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
model.contentChanged.connect(() => {
let widget = renderer.render('text/markdown', model.toString());
if (layout.childCount()) {
layout.childAt(0).dispose();
}
layout.addChild(widget);
});
示例2: updateTextEditor
/**
* Update the text editor model, creating a new text editor
* widget and detaching the old one.
*/
updateTextEditor(editor: IEditorModel) {
let layout = this.layout as PanelLayout;
if (layout.childCount() > 0) {
layout.childAt(0).dispose();
}
layout.addChild(new CodeMirrorWidget(editor));
}
示例3: list
/**
* Get an ordered list the toolbar item names.
*
* @returns A new array of the current toolbar item names.
*/
list(): string[] {
let names: string[] = [];
let layout = this.layout as PanelLayout;
for (let i = 0; i < layout.childCount(); i++) {
let widget = layout.childAt(i);
names.push(Private.nameProperty.get(widget));
}
return names;
}