alibaba / alibaba/lowcode-engine

setter多个配置无法联动的问题

Open
#2,033 3 comments 0 reactions 1 assignee Claimed by @liujuping View on GitHub
Dominant language
TypeScript
Stars
15.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

我有两个setter,动画类型选完后第二个配置项的值会动态改变,目前通过extraProps下的setValue和getValue方法。
![image](https://github.com/alibaba/lowcode-engine/assets/19951467/0f8a7ba8-ed5d-46b7-af0f-78f93da4b9e6)
点击之后会赋值第二个选择器,可是第二个选择器没有立即更新。需要切换下设计面板的组件重新点一下才能重新渲染上新的配置项
![image](https://github.com/alibaba/lowcode-engine/assets/19951467/f58d3897-71b7-4c8e-befd-792ea17abc18)
![image](https://github.com/alibaba/lowcode-engine/assets/19951467/e809da5d-2e86-48e0-a029-26a21a93c992)
附录:meta.js
```
{
setter: {
name:"aos",
componentName: 'ObjectSetter',
props: {
config: {
items: [
{
name: 'animation',
title: '动画类型',
setter: {
componentName: 'SelectSetter',
initialValue: '',
props: {
mode: 'single',
options: [
{
title: '默认',
value: '',
},
{
title: '淡入淡出',
value: 'fade',
},
{
title: '翻转',
value: 'flip',
},
{
title: '滑动',
value: 'slide',
},
{
title: '缩放',
value: 'zoom',
},
],
},
},
extraProps: {
setValue: (target, value) => {
const aos = target.getNode().settingEntry.get('aos.direction')
aos.setter.props.options = [{
title:"测试",
value: "dasa"
}]
},
getValue:(target) => {
const animation = target.getProps().getPropValue('aos.animation');
console.log('animation',animation)
return animation
}
}
},
{
name: 'direction',
title: '动画方向',
setter: {
componentName: 'SelectSetter',
props: {
options: [],
},
}
},
],
},
},
},
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.