fix(data-templates): filter is empty #2193
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (Bug 描述)
Steps to reproduce (复现步骤)
Expected behavior (预期行为)
filter 参数应该有值
Actual behavior (实际行为)
filter 参数为空
Related issues (相关 issue)
#2161
Reason (原因)
#2161 把
field.componentProps?.service?.params?.filter
修改成了fieldSchema?.['x-component-props']?.service?.params?.filter
以解决变量字符串(包裹在{{}}
中的字符串)被提前解析的问题。但是这里的fieldSchema?.['x-component-props']?.service?.params?.filter
的值是一个{{ getFilter($self.componentProps.service.resource, $self.value) }}
这样的字符串,这个字符串并不是一个变量,进而导致被解析为空。Solution (解决方案)
filter
参数通常是一个对象filter
是一个字符串的时候就可以假设这是类似于{{ 1 + 1 }}
的字符串field.componentProps
里面去取值,这里面的值是经过编译之后的值Testing
建议回归一下 #2161 @hongboji
其它
close T-858