import { BaseElementWidget, Widget, SPI, ViewType, TableSearchTreeWidget } from '@kunlun/dependencies';
@SPI.ClassFactory(
BaseElementWidget.Token({
viewType: ViewType.Table,
widget: 'tree',
model: '改成当前视图的模型'
})
)
export class CustomTableSearchTreeWidget extends TableSearchTreeWidget {
protected hasExe = false;
@Widget.Watch('rootNode.children.length')
protected watchRootNode(len) {
if (len && !this.hasExe) {
this.hasExe = true;
const firstChild = this.rootNode?.children?.[0];
if (firstChild) {
this.onNodeSelected(firstChild);
this.selectedKeys = [firstChild.key];
}
}
}
}
Oinone社区 作者:汤乾华原创文章,如若转载,请注明出处:https://doc.oinone.top/frontend/19595.html
访问Oinone官网:https://www.oinone.top获取数式Oinone低代码应用平台体验