lowcode-engine icon indicating copy to clipboard operation
lowcode-engine copied to clipboard

tsx文件无法生成defaultValue

Open CalmDownJ opened this issue 2 years ago • 4 comments

现象:使用脚手架 @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<TableProps> = function Test({
  id = 1,
}) {
  return <div>{id}</div>;
};

export default Test;

  1. 在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

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

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

CalmDownJ avatar Jun 01 '22 11:06 CalmDownJ

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

LeoYuan avatar Jun 07 '22 09:06 LeoYuan

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] avatar Jun 18 '22 02:06 github-actions[bot]

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

github-actions[bot] avatar Jun 21 '22 02:06 github-actions[bot]

有任何进展吗,这个issue

SamWeichangyue avatar Aug 10 '22 03:08 SamWeichangyue