alibaba / lowcode-engine

An enterprise-class low-code technology stack with scale-out design / 一套面向扩展设计的企业级低代码技术体系
https://lowcode-engine.cn
MIT License
14.66k stars 2.55k forks source link

tsx文件无法生成defaultValue #588

Open CalmDownJ opened 2 years ago

CalmDownJ commented 2 years ago

现象:使用脚手架 @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

{id}
; };

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值
![image](https://user-images.githubusercontent.com/20920943/171394851-c5abf37a-a4f4-46ec-bd1e-6d41cecbb6fb.png)

5. debug @alilc/lowcode-material-parser,发现第474行,info中 id的defaultValue是null
![image](https://user-images.githubusercontent.com/20920943/171393924-8fffdedc-d9f8-4798-bf77-4a0f2f1eeb1d.png)

6. 包的版本信息
    "@alib/build-scripts": "^0.1.32",
    "@alifd/build-plugin-lowcode": "^0.3.0",
    "name": "@alilc/lowcode-material-parser" 的版本是 "1.0.3"
LeoYuan commented 2 years ago

@akirakai defaultValue / initialValue 的问题看看能不能支持?🙏🏻

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 10 days with no activity.

SamWeichangyue commented 2 years ago

有任何进展吗,这个issue