本文整理匯總了TypeScript中@jupyterlab/notebook.NotebookActions.changeCellType方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript NotebookActions.changeCellType方法的具體用法?TypeScript NotebookActions.changeCellType怎麽用?TypeScript NotebookActions.changeCellType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@jupyterlab/notebook.NotebookActions
的用法示例。
在下文中一共展示了NotebookActions.changeCellType方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getCurrent
execute: args => {
let current = getCurrent(args);
if (!current) {
return;
}
return NotebookActions.changeCellType(current.notebook, 'code');
}
示例2: it
it('should preserve the types of each cell', () => {
NotebookActions.changeCellType(widget, 'markdown');
NotebookActions.splitCell(widget);
expect(widget.activeCell).to.be.a(MarkdownCellWidget);
let prev = widget.widgets[0];
expect(prev).to.be.a(MarkdownCellWidget);
});
示例3: getCurrent
execute: args => {
const current = getCurrent(args);
if (current) {
return NotebookActions.changeCellType(current.notebook, 'raw');
}
},
示例4: it
it('should change the selected cell type(s)', () => {
let next = widget.widgets[1];
widget.select(next);
NotebookActions.changeCellType(widget, 'raw');
expect(widget.activeCell).to.be.a(RawCell);
next = widget.widgets[widget.activeCellIndex + 1];
expect(next).to.be.a(RawCell);
});