背景
react-docgen-typescript会解析组件props包括这个props extend的interface. 例如你用antd Select自定义XXSelect, 不仅会解析出XXSelect的props还有antd select和rc-select. rc-select中大部分的props是不太可能在低代码编辑器上配置, 可以不生成.
实现建议
第二个参数可以传入配置, 过滤掉不想要的props
lowcode-engine/modules/material-parser/src/parse/ts/index.ts
Line 519 in d7132fa
| | constparser=newMyParser(program,{}); |
eg:
const parser = new MyParser(program, {
propFilter: props => {
// rc-xxx 组件的props太杂了,一般不会配置
if (props?.parent?.fileName?.includes('rc-')) {
return false;
}
return true;
},
});
建议 lowcode-material-parser
暴露这个配置
1条答案
按热度按时间14ifxucb1#
白嫖党, 不pr