本文整理匯總了TypeScript中@jupyterlab/docmanager.IDocumentManager.openOrReveal方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IDocumentManager.openOrReveal方法的具體用法?TypeScript IDocumentManager.openOrReveal怎麽用?TypeScript IDocumentManager.openOrReveal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@jupyterlab/docmanager.IDocumentManager
的用法示例。
在下文中一共展示了IDocumentManager.openOrReveal方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
.then(() => {
// Open the link with the default rendered widget factory,
// if applicable.
const factory = docManager.registry.defaultRenderedWidgetFactory(
path
);
const widget = docManager.openOrReveal(path, factory.name);
if (!widget) {
return;
}
return widget.revealed.then(() => {
// Once the widget is ready, attempt to scroll the hash into view
// if one has been provided.
if (!id) {
return;
}
// Look for the an element with the hash id in the document.
// This id is set automatically for headers tags when
// we render markdown.
const element = widget.node.querySelector(id);
if (element) {
element.scrollIntoView();
}
return;
});
});
示例2:
.then(() => {
// Open the link with the default rendered widget factory,
// if applicable.
const factory = docManager.registry.defaultRenderedWidgetFactory(
path
);
const widget = docManager.openOrReveal(path, factory.name);
// Handle the hash if one has been provided.
if (widget && id) {
widget.setFragment(id);
}
});
示例3:
.then(() => docManager.openOrReveal(path, factory, kernel, options));
示例4:
.then(() => docManager.openOrReveal(path, factory));