alibaba

alibaba

Alibaba Open Source

Member Since 9 years ago

Hangzhou, China

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
436
repos
Activity
May
19
20 hours ago
started
started time in 4 hours ago
started
started time in 5 hours ago
started
started time in 5 hours ago
started
started time in 5 hours ago
started
started time in 5 hours ago
push

LaurenceLiZhixin push alibaba/IOC-Golang

LaurenceLiZhixin
LaurenceLiZhixin

fix: readme, change describer to descriptor

Signed-off-by: LaurenceLiZhixin [email protected]

LaurenceLiZhixin
LaurenceLiZhixin

Merge remote-tracking branch 'upstream/master' into example-readme

LaurenceLiZhixin
LaurenceLiZhixin

fix: docs position

Signed-off-by: LaurenceLiZhixin [email protected]

LaurenceLiZhixin
LaurenceLiZhixin

Merge pull request #10 from LaurenceLiZhixin/example-readme

Fix: readme and typos.

commit sha: fcd0e450b9ba6912517fcfe26b972bbefbf87467

push time in 5 hours ago
pull request

LaurenceLiZhixin pull request alibaba/IOC-Golang

LaurenceLiZhixin
LaurenceLiZhixin

Fix: readme and typos.

  • change describer to descriptor
pull request

LaurenceLiZhixin pull request alibaba/IOC-Golang

LaurenceLiZhixin
LaurenceLiZhixin

Fix: readme and typos.

  • change describer to descriptor
started
started time in 5 hours ago
Activity icon
fork

siyuan797 forked alibaba/spring-cloud-alibaba

⚡ Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
siyuan797 Apache License 2.0 Updated
fork time in 5 hours ago
Activity icon
issue

skylarCai issue comment alibaba/AliOS-Things

skylarCai
skylarCai

add alcohol_detector, fix #1649

[Detail] add alcohol detector.

[Verified Cases] Build Pass: <py_engine_demo> Test Pass: <py_engine_demo>

skylarCai
skylarCai

autotest success,number:1311

Activity icon
issue

Dogtiti issue alibaba/lowcode-engine

Dogtiti
Dogtiti

如何更新受控子组件

Formily2.x 已经放弃了给表单组件和字段组件支持受控模式,因为表单内部管理状态模式本身就不是受控模式,在将受控模式转为非受控模式的过程中会有很多边界问题,同时受控模式会存在大量的脏检查过程,性能很不好,反而非受控模式本身就可以解决大部分问题了。

所以 Formily 就不再支持受控模式了,但是如果我们硬要实现普通 React 受控,还是可以支持的,只不过只能实现值受控,不能实现字段级受控,也就是我们使用的 Field 组件,属性只会在初次渲染时生效,未来属性发生任何变化都不会自动更新,想要自动更新,除非重新创建 Form 实例。

formily进行封装,如上所说结合下面代码 Field直接接收props.gridSpan是不会触发更新的,需要const form = React.useMemo(() => createForm(), [gridSpan]);gridSpan作为依赖项,重新创建Form实例才会触发重新渲染,然而在Field作为物料时,props是不经过Form的,导致没办法触发重新渲染

//正常情况下表单受控触发更新
const Form: React.FC<FormProps> = (props) => {
  const { children, ...restProps } = props;
  const { gridSpan} = restProps;

  const form = React.useMemo(() => createForm(), [gridSpan]);

  return (
    <Form form={form} colon={colon}>
      <FormGrid maxColumns={4} minColumns={4} columnGap={10}>
         <Field title={'title'} decorator={[FormItem, { gridSpan }]} name={'name'} component={[Input]} />
      </FormGrid >
    </Form>
  );
};
//低代码中由于<Field/>是物料,属性是通过`setter`面板直接透传过来的,没有经过`Form`,也就导致未受控,不会触发更新
const Form: React.FC<FormProps> = (props) => {
  const { children, ...restProps } = props
  const form = React.useMemo(() => createForm(), []);

  return (
    <Form form={form} colon={colon}>
       <FormGrid maxColumns={4} minColumns={4} columnGap={10}>
          {children}
       </FormGrid >
    </Form>
  );
};
//<FormInput/>作为物料直接被传递属性,导致无法更新
const FormInput: React.FC<ProFormInputProps> = (props) => {
  const { name = 'undefined', title = '表单项', gridSpan } = props;
  return (
    <Field title={title} decorator={[FormItem, { gridSpan }]} name={name} component={[Input]} />
  );
};

如上代码和repo,有没有办法处理或者最佳实践,亦或者说目前这样的设计方向是不是对的,我现在有点疑惑

repo: https://github.com/Dogtiti/formily-sandbox.git codesandbox: https://codesandbox.io/s/dogtiti-formily-sandbox-7o958z (好像不太好使,依赖比较慢) 执行npm run lowcode:dev启动,然后拖拽高级表单(已经配置好,最外层是Form,会有一个网格布局FormGrid,然后有一个Input)到画布. 点到网格布局配置,可以修改max,min columns 4625b99346a5168a99415bbc502c778 然后再点到输入框,可以配置列数 1fc2520905694ca6b708bebfc96baaa

此时gridSpan是不会触发更新的因为没受控,因为gridSpan是通过右侧setter直接传递到FormItem(输入框),不经过Form`层,原因如上述,不知道这里处理的最佳实践是什么

Form 层:https://github.com/Dogtiti/formily-sandbox/blob/main/src/components/pro-form/pro-form.tsx FormGrid层:https://github.com/Dogtiti/formily-sandbox/blob/main/src/components/pro-form-grid/pro-form-grid.tsx FormInput层:https://github.com/Dogtiti/formily-sandbox/blob/main/src/components/pro-form-input/pro-form-input.tsx

started
started time in 5 hours ago
started
started time in 5 hours ago
started
started time in 5 hours ago
started
started time in 5 hours ago
started
started time in 5 hours ago
push

dawn310826 push alibaba/EasyRec

dawn310826
dawn310826

fix bug of wrong variable name (#188)

commit sha: f6e68c499720f46c11d6d5085d2184f3004add51

push time in 6 hours ago
pull request

dawn310826 pull request alibaba/EasyRec

dawn310826
dawn310826

fix bug of wrong variable name

fix bug of wrong variable name

started
started time in 6 hours ago
Activity icon
issue

Dogtiti issue alibaba/lowcode-engine

Dogtiti
Dogtiti

画布与预览页面不一致,丢失了`style`

原子组件=>表单容器,开启响应式布局属性responsive:true 引擎,物料库版本都是最新

image image 导致在画布页面无法动态展示grid布局的效果,但是预览时又是正常的