alibaba / alibaba/lowcode-engine
tsx文件无法生成defaultValue
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
现象:使用脚手架 @alilc/element 生成的组件库项目,执行 npm run lowcode:build 后,lowcode文件夹中的代码没有defaultValue内容
步骤:
1. 使用脚手架生成组件库项目
2.在src中增加组件test.tsx,内容如下:
```
import * as React from 'react';
import { createElement } from 'react';
export interface TableProps {
id?: number;
}
const Test: React.FC = function Test({
id = 1,
}) {
return
};
export default Test;
```
3. 在src/index.tsx中暴露组件和type
```
export type { TestProps } from './components/test'
export { default as Test } from './components/test'
```
4.执行 npm run lowcode:build,lowcode文件夹中没有Test的defaultValue值

5. debug @alilc/lowcode-material-parser,发现第474行,info中 id的defaultValue是null

6. 包的版本信息
"@alib/build-scripts": "^0.1.32",
"@alifd/build-plugin-lowcode": "^0.3.0",
"name": "@alilc/lowcode-material-parser" 的版本是 "1.0.3"
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.