defaultWidgetOptions的area参数区别
自定义组件时,Contribution构造函数中,可以通过defaultWidgetOptions的area参数指定widget显示的位置,如下:
export const MyWidgetCommand: Command = { id: 'MyWidget:command' };
@injectable()
export class MyWidgetContribution extends AbstractViewContribution<MyWidgetWidget> {
constructor() {
super({
widgetId: MyWidgetWidget.ID,
widgetName: MyWidgetWidget.LABEL,
defaultWidgetOptions: { area: 'bottom' },
toggleCommandId: MyWidgetCommand.id
});
}
}
theia当前支持4个位置:`main`, `left`, `right`, `bottom`,显示效果分别如下:
main:

left:

right:

bottom:


浙公网安备 33010602011771号